Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Does anybody a method to navigate to another site? I usually use
Response.Redirect("Home.aspx");

but now i want to navigate to external url . For example i tried
Response.Redirect("https://www.google.com");
but this works only on localhost , when my site is on server this doesn't work. Thanks in advance!
Posted
Comments
Sergey Alexandrovich Kryukov 21-Sep-14 12:31pm    
It should work (second sample). The first one depends on the location of "Home.aspx"...
—SA
Alex Slusar 21-Sep-14 12:33pm    
The first one works ,the second doesn't works
Sergey Alexandrovich Kryukov 21-Sep-14 13:31pm    
Okay, forget the first one; when the second one does not work?
—SA
Afzaal Ahmad Zeeshan 21-Sep-14 14:22pm    
When the site is on the hosting server. Not on the development (local server). I think the CORS is taking place here somewhere.
AndrewCharlz 22-Sep-14 0:26am    
did u get any error

1.The method Response.Redirect(url) should work. See details here:
http://msdn.microsoft.com/en-us/library/ms524309(v=vs.90).aspx[^]

2.In your case you should try without HTTPS, just simple HTTP: Response.Redirect("http://www.google.com");
 
Share this answer
 
You should try this..

<asp:Hyperlink NavigateUrl="URL" runat="server" />

this NavigateUrl property

Example:

<form runat="server">
<asp:Hyperlink id="" runat="server" text="" NavigateUrl="http://www.google.com"> </form>
 
Share this answer
 
v2

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