导航到其他站点ASP.NET [英] Navigate to other site ASP.NET
本文介绍了导航到其他站点ASP.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人有办法导航到另一个网站吗?我通常使用
Response.Redirect(Home.aspx);
但现在我想导航到外部网址。例如,我试过
Response.Redirect(https://www.google.com);
但这仅适用于localhost,当我的网站在服务器上时,这不会工作。在此先感谢!
解决方案
1.方法Response.Redirect(url)
应该有效。详情请见:
http:// msdn .microsoft.com / zh-CN / library / ms524309(v = vs.90).aspx [ ^ ]
2.在您的情况下,您应该尝试没有HTTPS,只需简单的HTTP:Response.Redirect(http://www.google.com);
你应该试试这个..
< asp:Hyperlink NavigateUrl =URLrunat =server/>
这个NavigateUrl属性
例如:
< form runat =server> ;
< asp:Hyperlink id =runat =servertext =NavigateUrl =http://www.google.com> < /形式>
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!
解决方案
1.The methodResponse.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");
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>
这篇关于导航到其他站点ASP.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文