Click here to Skip to main content
15,889,595 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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"];
Posted

1 solution

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


--Amit
 
Share this answer
 
v4
Comments
Gunjan Bhasin 8-Feb-13 1:52am    
error:
Server Error in '/' Application.

String reference not set to an instance of a String.
Parameter name: s
_Amy 8-Feb-13 1:55am    
Check querystring values.
Gunjan Bhasin 8-Feb-13 1:57am    
not working. Giving above error.
Gunjan Bhasin 8-Feb-13 2:10am    
Thanks Amit but I am not getting the result. If you can guide me with other way instead of Response.Redirect it will also be helpful.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900