asp.net导出到excel
导出到excel的方法有多种,比较常见的是直接导出到EXCEL,还有就是先将页面的数据写到磁盘文件,之后直接再打开文件,另外还有就
是借助第三方的控件。
前段时间写的导出数据到excel在excel2003中正常而在excel2007中数据乱码,今天了解到原来是Response.ContentType = "application/ms-excel";导致的,改为Response.ContentType = "application/vnd.ms-excel";正常
public partial class Manager_ExportOrder : ShopOrderBase
{
#region 事件
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.btnSubmit.Visible = true;
this.btnDelete.Visible = false;
BindGridView();
//显示提示信息
IList<WfmSysDictionaryItems> lst = GetChildOfFunPurview(Resources.Resource.safeMange);
if (lst != null || lst.Count > 0)
{
if (lst.Count == 1 && lst[0].SiName.Contains("一个月"))
{
lblShow.Text = "以下数据是上个月之前的所有订单";
}
相关文档:
"服务器名称:"+Server.MachineName;//服务器名称
"服务器IP地址:" + Request.ServerVariables["LOCAL_ADDR"];//服务器IP地址
&nbs ......
//以下代码根据别人文章和自己整理
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
namespace WebApplication1
{
public partial class DownfFile : System.Web.UI.Page
{
p ......
1、建立数据层 连接数据库->建立数据集*.xsd->表中建立查询方法
2、建立业务逻辑层 包装TableAdapter方法成类
3、建立母板页和站点导航( CSS待学习)
4、使用数据源展现数据 五种数据源 编辑数据源参数 使用tableadapter方法
5、使用dropDownList过滤主-从报表
使用tableadapter方法 ......
ASP.NET
使用无Cookie的表单认证票据
默认情况下,forms authentication system将决定是将票据存储在cookies
collection里还是插入用户访问页面的URL里。所有主流的桌面浏览器,比如Internet
Explorer,Firefox,Opera,或Safari都支持cookies,但并非所有的移动设备都支持。
forms authentication system使用何种co ......