出错了!大家帮帮忙呀!!急
protected void GridView1_SelectedIndexChanged1(object sender, EventArgs e)
{
string id = ((LinkButton)(this.GridView1.SelectedRow.FindControl( "LbWorkerInfo "))).Text;
string script = " <script> ";
script += "window.open( ' ";
script += "WorkerInfo_Browse?id= ";
script += id;
script += ".aspx ' ";
script += ", ' ', 'width=550,height=210,scrollbars=no ') ";
script += " </script> ";
Response.Write(script);
}
这段代码
结果出错了
“/CarWash”应用程序中的服务器错误。
--------------------------------------------
无法找到资源。
说明: HTTP 404。您正在查找的资源(或者它的一个依赖项)可能已被移除,或其名称已更改,或暂时不可用。请检查以下 URL 并确保其拼写正确。
请求的 URL: /CarWash/LeftFrame/WorkerInfo_Browse
谁帮忙看一下
------解决方案--------------------script += "WorkerInfo_Browse?id= ";
script += id;
script += ".aspx '
换成
script += "WorkerInfo_Browse.aspx?id= ";
script += id;
------解决方案-------------------- script += "window.open( ' ";
script += "WorkerInfo_Browse?id= ";
script += id;
script += ".aspx ' ";
script += "WorkerInfo_Browse?id= ";改为
script += "window.open( ' ";
script += "WorkerInfo_Browse.aspx?id= ";
script += id;
script += " ', ' ', 'width=550,height=210,scrollbars=no ') ";
script += " </script> ";
Response.Write(script);
------解决方案--------------------string id = ((LinkButton)(this.GridView1.SelectedRow.FindControl( "LbWorkerInfo "))).Text;
string strUrl = Server.HtmlEncode( "WorkerInfo_Browse.aspx?ID= "+id );
Response.Write( " <script> window.open( ' " + strUrl + " ', ' ', 'width=550,height=210,directories=no,status=no '); </script> ");