我们可以使用Response.Redirect重定向到其他应用程序的页面 [英] Can we use Response.Redirect to redirect to the page of other application

查看:280
本文介绍了我们可以使用Response.Redirect重定向到其他应用程序的页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用3.5framework中的两个asp.net webproject。



我使用Response.Redirect重定向到其他页面,并使用查询字符串传递数据在同一个应用程序中正常工作,但当我重定向到其他应用程序时,它给我一个错误。

代码:

(同一项目的工作代码)



Response.Redirect(confirm_book.aspx?Data =+ Server.UrlEncode(txtfname.Text)+&Data1 =+ Server.UrlEncode(txtlname.Text));



(重定向到其他网站时没有工作代码)



Response.Redirect(http:/ /abc.com/confirm_book.aspx?Data=+ Server.UrlEncode(txtfname.Text)+&Data1 =+ Server.UrlEncode(txtlname.Text));





(在confirm_book.aspx页面加载事件中)



string fname = Request.QueryString [Data];

string lname = Request.QueryString [Data1];

解决方案

试试这个:

 Response.Redirect(  http://abc.com/confirm_book.aspx?Data= + Server.UrlEncode(txtfname.Text)+  & Data1 = + Server.UrlEncode(txtlname.Text), true ); 





--Amit


I am working on two asp.net webprojects in 3.5framework.

I have used Response.Redirect to redirect to other page with passing data using query string its working fine with in same application but when I am redirecting to other application it is giving me an error.
code:
(working code for same project)

Response.Redirect("confirm_book.aspx?Data=" + Server.UrlEncode(txtfname.Text) + "&Data1=" + Server.UrlEncode(txtlname.Text));

(not working code when redirecting to other website instead)

Response.Redirect("http://abc.com/confirm_book.aspx?Data=" + Server.UrlEncode(txtfname.Text) + "&Data1=" + Server.UrlEncode(txtlname.Text));


(on confirm_book.aspx page load event)

string fname=Request.QueryString["Data"];
string lname=Request.QueryString["Data1"];

解决方案

Try this:

Response.Redirect("http://abc.com/confirm_book.aspx?Data=" + Server.UrlEncode(txtfname.Text) + "&Data1=" + Server.UrlEncode(txtlname.Text), true);



--Amit


这篇关于我们可以使用Response.Redirect重定向到其他应用程序的页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆