码迷,mamicode.com
首页 > 其他好文 > 详细

实现对附件的操作.

时间:2016-01-25 13:02:50      阅读:119      评论:0      收藏:0      [点我收藏+]

标签:

在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>&nbsp;&nbsp;<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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!