易截截图软件、单文件、免安装、纯绿色、仅160KB

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 = "以下数据是上个月之前的所有订单";
                  }
        


相关文档:

定义和使用ASP.NET Profile(附例)

1、双击一个数据源控件,将要存储profile的数据库作为数据源加入控件(这个步骤没什么用,只是为了方便大家用控件建立连接,这样不容易出错),建立好之后将design页面的数据源控件删除,你会发现在web.config里还是有一条连接语句,不要删除,我们下面将用到它,如: <connectionStrings>
  <add ......

ASP.NET 2.0中实现模板中的数据绑定

模板化的数据绑定控件为我们在页面上显示数据提供了根本的灵活性。你可能还记得ASP.NET v1.x中的几个模板化控件(例如DataList和Repeater控件)。ASP.NET 2.0仍然支持这些控件,但在模板中绑定数据的语法已经被简化和改善了。本文将讨论在数据绑定控件模板中绑定数据的多种方法。
数据绑定表达式
ASP.NET 2.0改善了模板中 ......

ASP.NET Mischellous

@Register : Register a user control or class with alias to this page.
@Import: Import a namespace.
@Reference: Link user controls or other page to complile current page. 支持数据跨页面的传送
页面事件:PreInit(创建服务器控件), Init(初始化服务器控件的状态), InitComplete,PreLoad, Load, Lo ......

asp.net 用流的方式下载文件

//以下代码根据别人文章和自己整理
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 ......

ASP.NET弹出确认窗口

在ASP.NET 1.1中,要做1个弹出的确认对话框的话,一般是在服务端的代码中这样写:
private void Page_Load(object sender, System.EventArgs e)
{
    btnClick.Attributes.Add("onclick", "return confirm('Are you sure?');");
    // Button1.Attributes["OnClick"] = "return conf ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号