标签:
在html页面中定义附件初始情况
<td style="background:#F3F8FD; border-top-style: none; border-top-color: inherit; border-top-width: medium;" class="style1"> 附件: </td> <td colspan="3"; style="background:#F3F8FD;width:795px;padding-left:1px;border-top:none;"> <asp:Literal ID="attachementLite" runat="server"></asp:Literal> <table id="upDiv" border="0" style="margin-bottom: 5px;"> <tr> <td> <input type="file" name="upfile" style="width: 190px;height:20px;" class="txt" /> </td> <td align="right"> <span style="padding-left: 2px;"> <input type="button" onclick="addFile();" class="btn" name="next" value="增加" style="width: 48px; height: 18px; line-height: 16px;" /></span> </td> </tr> </table> </td>
后台读取附件表数据,并加载到前台显示
FileUploadBLL fileUploadBll = new FileUploadBLL(); IList<Model.FileUpload> attachmentList = fileUploadBll.GetListByEntityId(sysid); StringBuilder strAttachment = new StringBuilder(); if (attachmentList != null) { foreach (Model.FileUpload fup in attachmentList) { strAttachment.Append("<span id=\"div" + fup.sysId + "\"><a href=\"#\" onclick=\"downLoadFilesel(‘" + fup.sysId + "‘)\">" + fup.name + "</a> <a style=\"cursor:pointer\" onclick=\"delFile(‘" + fup.sysId + "‘)\">删除</a></span><br />"); } if (attachmentList.Count > 0) { attachementLite.Text = strAttachment.ToString(); } }
标签:
原文地址:http://www.cnblogs.com/Zpyboke/p/5157017.html