摘要:在网页中选择本地Excel文件并获取文件内容,需要将该文件首先上传到服务器上,然后再根据该文件在服务器上的地址获取该文件的内容,代码如下 :///<summary>///上传文件的根目录///</summary>privatestringbootPath=HttpContext.Current.Request.PhysicalApplicationPath+"Files\\";protectedvoidbtnSubmit_Click(objectsender,EventArgse){if(file_note.HasFile){//判断文件是否小于10
阅读全文
摘要:#regionExporttoWord,ExcelandPDFprotectedvoidbtnword_Click(objectsender,EventArgse){Response.AddHeader("content-disposition","attachment;filename=FileName.doc");Response.Cache.SetCacheability(HttpCacheability.NoCache);Response.ContentType="application/vnd.word";System.IO
阅读全文
摘要:用服务器端的方法:在页面上放一个gridview控件,配置好数据源,编辑列,添加一个模版列,再编辑模版,放入一个checkbox控件。代码如下:<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False" DataKeyNames="AreaID" DataSourceID="SqlDataSource1"> <Columns> &l
阅读全文
摘要:在<head></head>之间加入 <base target="_self"/>即可
阅读全文