我是否想要更改我的托管代码 [英] Whether I Want To Change My Code For Hosting
本文介绍了我是否想要更改我的托管代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我将举一个简单的例子
response.redirect(default.aspx)
我是否需要在托管前更改此代码
请解释我或发送给我任何提供此链接的链接
$ b $我很困惑
解决方案
除非你改变托管项目文件夹结构,否则无需更改。
路径应该相对于您重定向的 Page 。
例如 - 在您的情况下,ASP.NET
引擎假定 Page 出现在同一文件夹/目录作为源页面。
参考 - HttpResponse.Redirect方法(字符串,布尔值) [ ^ ]。
引用:绝对URL(例如,http://www.contoso.com/default.aspx)或者可以为目标位置指定相对URL(例如,Default.aspx),但某些浏览器可能会拒绝相对URL。
I will give simple example
response.redirect("default.aspx")
whether i need to change this code before hosting
please explain me or send me any link providing this
i am totally confused
解决方案
No need to change, unless you change the Hosted Project Folder structure.
The Path should be relative to the Page, from which you are redirecting.
For Example - In your case,ASP.NET
Engine assumes the Page is present in the same Folder/Directory as the Source Page.
Refer - HttpResponse.Redirect Method (String, Boolean)[^].
Quote:An absolute URL (for example, http://www.contoso.com/default.aspx) or a relative URL (for example, Default.aspx) can be specified for the target location but some browsers may reject a relative URL.
这篇关于我是否想要更改我的托管代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文