To define an attachment's initial condition in an HTML page
<TDstyle= "background: #F3F8FD; border-top-style:none; border-top-color:inherit; border-top-width:medium;"class= "Style1">Accessories:</TD> <TDcolspan= "3"; style= "background: #F3F8FD; width:795px;padding-left:1px;border-top:none;"> <asp:literalID= "Attachementlite"runat= "Server"></asp:literal> <TableID= "Updiv"Border= "0"style= "margin-bottom:5px;"> <TR> <TD> <inputtype= "File"name= "Upfile"style= "width:190px;height:20px;"class= "txt" /> </TD> <TDAlign= "Right"> <spanstyle= "PADDING-LEFT:2PX;"> <inputtype= "button"onclick= "AddFile ();"class= "BTN"name= "Next"value= "Add"style= "WIDTH:48PX; height:18px; line-height:16px; " /></span> </TD> </TR> </Table> </TD>
The background reads the attachment table data and loads it into the foreground display
FILEUPLOADBLL FILEUPLOADBLL =NewFILEUPLOADBLL (); IList<Model.FileUpload> attachmentlist =Fileuploadbll.getlistbyentityid (SYSID); StringBuilder strattachment=NewStringBuilder (); if(Attachmentlist! =NULL) { foreach(Model.fileupload fupinchattachmentlist) {Strattachment.append ("<span id=\ "Div"+ Fup.sysid +"\ "><a href=\" #\ "onclick=\" Downloadfilesel ('"+ Fup.sysid +"') \ ">"+ Fup.name +"</a> <a style=\ "Cursor:pointer\" onclick=\ "Delfile ('"+ Fup.sysid +"') \ ' > Delete </a></span><br/>"); } if(Attachmentlist.count >0) {Attachementlite.text=strattachment.tostring (); } }
Implements the operation on the attachment.