我需要实现的效果是点击一个页面的超链接之后跳转到另外一个页面,将查询的结果返回出来,其中跳转到的那个页面上有一个button,提供存为excel档的功能。
我将变量用sesson保存起来,在跳转到的页面中的page_load中将需要的数据处理出来
if (!IsPostBack)
{
try
{
cell.Impl.CellDefectInfo Condition = (cell.Impl.CellDefectInfo)Session["_parameterInfo"];
int flag = int.Parse(Session["flag"].ToString());
GetDetailData(ref Condition, ScrapDetailGv, flag);
}
catch (Exception ex)
{
ex.ToString();
}
}
这些都可以实现,但是当我点页面的存为excel档的时候就挂了,我将page_load设了断点,好像点button的时候根本就没有跑page_load就直接死掉了The page cannot be displayed
The page you are looking for is currently unavailable. The Web site might be experiencing technical difficulties, or you may need to adjust your browser settings. --------------------------------------------------------------------------------Please try the following:Click the Refresh button, or try again later.If you typed the page address in the Address bar, make sure that it is spelled correctly.To check your connection settings, click the Tools menu, and then click Internet Options. On the Connections tab, click Settings. The settings should match those provided by your local area network (LAN) administrator or Internet service provider (ISP).
See if your Internet connection settings are being detected. You can set Microsoft Windows to examine your network and automatically discover network connection settings (if your network administrator has enabled this setting).
Click the Tools menu, and then click Internet Options.
On the Connections tab, click LAN Settings.
Select Automatically detect settings, and then click OK.
Some sites require 128-bit connection security. Click the Help menu and then click About Internet Explorer to determine what strength security you have installed.
If you are trying to reach a secure site, make sure your Security settings can support it. Click the Tools menu, and then click Internet Options. On the Advanced tab, scroll to the Security section and check settings for SSL 2.0, SSL 3.0, TLS 1.0, PCT 1.0.
Click the Back button to try another link.
我完全不知道怎么一回事,请高手指点一下,这个问题好奇怪啊。
我将变量用sesson保存起来,在跳转到的页面中的page_load中将需要的数据处理出来
if (!IsPostBack)
{
try
{
cell.Impl.CellDefectInfo Condition = (cell.Impl.CellDefectInfo)Session["_parameterInfo"];
int flag = int.Parse(Session["flag"].ToString());
GetDetailData(ref Condition, ScrapDetailGv, flag);
}
catch (Exception ex)
{
ex.ToString();
}
}
这些都可以实现,但是当我点页面的存为excel档的时候就挂了,我将page_load设了断点,好像点button的时候根本就没有跑page_load就直接死掉了The page cannot be displayed
The page you are looking for is currently unavailable. The Web site might be experiencing technical difficulties, or you may need to adjust your browser settings. --------------------------------------------------------------------------------Please try the following:Click the Refresh button, or try again later.If you typed the page address in the Address bar, make sure that it is spelled correctly.To check your connection settings, click the Tools menu, and then click Internet Options. On the Connections tab, click Settings. The settings should match those provided by your local area network (LAN) administrator or Internet service provider (ISP).
See if your Internet connection settings are being detected. You can set Microsoft Windows to examine your network and automatically discover network connection settings (if your network administrator has enabled this setting).
Click the Tools menu, and then click Internet Options.
On the Connections tab, click LAN Settings.
Select Automatically detect settings, and then click OK.
Some sites require 128-bit connection security. Click the Help menu and then click About Internet Explorer to determine what strength security you have installed.
If you are trying to reach a secure site, make sure your Security settings can support it. Click the Tools menu, and then click Internet Options. On the Advanced tab, scroll to the Security section and check settings for SSL 2.0, SSL 3.0, TLS 1.0, PCT 1.0.
Click the Back button to try another link.
我完全不知道怎么一回事,请高手指点一下,这个问题好奇怪啊。
解决方案 »
- 使用FindControl找CheckBox,CheckBox一直为false,求解
- js如何实现去掉字符串最后的换行?
- matlab中生成.net的dll的诡异问题
- 如何手写webserivce的cs文件 ?
- ASP的程序换成ASP。NET应该怎么写?(菜问题)
- 使用RDLC报表 饼图因为数据多显示密集采用了CollectedStyle属性。但会出现颜色一样。
- 求一个验证多个email地址的正则表达式,解决马上给分!!!!
- 如何让界面自动跳转(定时,需要显示效果)
- 问一个关于自定义控件的问题
- 文件复制的问题
- 不加runat如何在后台控制html控件?
- |zyciis| 如何给我的用户控件添加二级属性,谢谢
{
try
{
cell.Impl.CellDefectInfo Condition = (cell.Impl.CellDefectInfo)Session["_parameterInfo"];
int flag = int.Parse(Session["flag"].ToString());
GetDetailData(ref Condition, ScrapDetailGv, flag);
}
catch (Exception ex)
{
ex.ToString();
}
} 你这个是在IsPostBack里 点按钮当然不会执行这里面的代码。。IsPostBack 是第一次加载 你以后点按钮怎么会触发这个了
protected void Export(string FileType, string FileName)//把数据从Gridview导出到excel的方法
{
Response.AppendHeader("Content-Disipostion", "attachment;filename=" + HttpUtility.UrlEncode(FileName, System.Text.Encoding.Default).ToString());
Response.ContentType = FileType;
this.EnableViewState = false;
StringWriter tw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(tw);
ScrapDetailGv.RenderControl(hw);
Response.Write(tw.ToString());
Response.End();
}
如果设为false就基本上没有办法存为一个excel档了