易截截图软件、单文件、免安装、纯绿色、仅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获取服务器信息

"服务器名称:"+Server.MachineName;//服务器名称 
                  "服务器IP地址:" + Request.ServerVariables["LOCAL_ADDR"];//服务器IP地址 
          &nbs ......

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 ......

Bind和Eval的不同用法 (asp.net C#)

今天在用DataList的模板列的时候习惯性地像在03中那样去给模板列的绑定字段加个处理函数:
 < asp:Label ID = " Label1 " runat = " server " Text = ' <%#ConvertState(Bind("Status"))%> ' ></ asp:Label >
     可是竟然出错:当前上下文中不存在名称“Bind” ......

vs2005不能调试ASP.NET程序

解决方法:
1.看看你的Terminal Services服务启动没有,如果没有启动就可以解决问题。
2确认  Machine  Debug  Manager  服务已启动
3、打开项目属性,在“Debug”(调试)一项里,把“Enable the Visual Studio hosting process”(启用Visual Studio 宿主进程)前的钩去掉。
4. ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号