日期:2014-05-19  浏览次数:20325 次

Response问题!
我有三个页面,不妨暂定为A.aspx,B.aspx和C.aspx。
页面A.aspx调用页面B.aspx,页面B.aspx验证接收到的参数是否正确,如果接收到的参数正确的话,将返回页面A.aspx一个接收成功的消息,同时调用页面C.aspx进行其它的业务处理。
请问各位大牛如何实现?

------解决方案--------------------
沙发
------解决方案--------------------
你的调用是什么意思?是Redirect,window.open还是只是用到页面类其中的一个方法?
------解决方案--------------------
if (!IsPostBack)
{
if (Request.QueryString[ "paras "] != null)
{
paras = DataMethod.ParamsDecode(Request.QueryString[ "paras "]);
_dept = paras[0];
_branch =paras[1];
_pro = paras[2];
this.Lid.Text = paras[3];
}
else
{
error
}
}
------解决方案--------------------
最好用session
------解决方案--------------------
用Session暂存数据,用window.open或者Redirect打开相关页面
------解决方案--------------------
或者
先window.open一个页面,
然后window.location.href=一个页面
------解决方案--------------------
server.transfer

session

看这里
http://www.yitian130.com/article.asp?id=75
------解决方案--------------------
server.transfer
在A里定义几个属性,通过在其他页上改变它里的webcontrol的属性实现

------解决方案--------------------
session 传值ok
------解决方案--------------------
用window.open打开B
B用window.opener操作A
------解决方案--------------------
简单例子 供参考

===============================
页面A
a.aspx//

<asp:Label id= "Label1 " runat= "server "> Label </asp:Label>
<asp:Button id= "Button1 " runat= "server " Text= "Button "> </asp:Button>

a.aspx.cs//

private void Button1_Click(object sender, System.EventArgs e)
{
string str = "我就是不说 ";
Response.Write( " <script> window.open( 'b.aspx?pwd= "+str+ " ', ' ', 'width:300px;heigth:300px ') </script> ");
}

=================
页面B
b.aspx
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
if(!IsPostBack)
{
string pwd = Request.QueryString[ "pwd "].Trim().ToString();
if( pwd == "我就是不说 " )//判断
{
//Response.Write(pwd);
Response.Write( " <script> window.opener.document.getElementById( 'Label1 ').innerText= '你通过了 ' </script> ");
Response.Write( " <script> window.open( 'c.aspx ') </script> ");//调用C
//Response.Write( " <script> window.close() </script> "); 用完可以关闭 b.asxp
}
else
Response.Write( " <script> window.opener.document.getElementById( 'Label1 ').innerText= '你没通过 ' </script> ");
}
}
------解决方案--------------------
在页面A中判断参数,如paramb是由B页发出的,则判断paramB是否存在,如存在,则弹出消息,等用户单击后再转向C页面,否则转向B页面,
不知道是不是LZ所要的?
------解决方案--------------------
用javascript 来实现 不用 response