首页 > 其他 > 详细

实现对附件的操作.

时间:2016-01-25 13:02:45      阅读:287      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!