0

I have a website in aspx with c # and am having trouble making the transition between pages. I tulizando the following code; response.redirect ("page.aspx"), where the url should be www.mysite.com.br / sipp / page.aspx, but the url is being passed www.mysite.com.br/sipp/ 2fsipp% 2f% / page.aspx. causing the page not found.

How do I fix this?

3 Answers3

0

The right syntaxe is

Response.Redirect([url]);

where the [url] is the path to your required page.

In your case you should try :

Response.Redirec("/fsipp/page.aspx");
Muffun
  • 726
  • 1
  • 9
  • 27
0

try with this code.

Response.Redirec("/sipp/page.aspx");

you can also try with another way: Server.Transfer()

Server.Transfer("/sipp/page.aspx");

If you are using Server.Transfer() then you can directly access the values, controls and properties of the previous page which you can’t do with Response.Redirect().

http://arplis.com/difference-between-server-transfer-and-response-redirect/

AKZap
  • 1,181
  • 6
  • 17
  • 31
  • I've tried both ways and it did not work, the project name is added to the url. Server.Transfer gives problem with AJAX. – MadsonBraz May 04 '12 at 08:49
0

Try encoding the URL being passed to Response.Redirect as follows:

Response.Redirect( Server.URL.Encode("myUrl"));
laconicdev
  • 6,360
  • 11
  • 63
  • 89