如果我有页面位于例如
http://hostname.com/website_folder/page1.aspx
字符串从内部文件夹中的页面,我想重定向到上面的页面例如从这些页面:
http://hostname.com/website_folder/folder1/folder2/page2.aspx
型或者是
http://hostname.com/website_folder/folder1/folder2/folder3/page2.aspx
型
mgdq6dx11#
尝试使用Response.Redirect(您的URL);在代码的后面页。如果您想了解更多信息,请阅读此处http://support.microsoft.com/kb/307903
vptzau2j2#
我假设每当请求来到下面的URLhttp://hostname.com/website_folder/folder1/folder2/page2.aspxhttp://hostname.com/website_folder/folder1/folder2/folder3/page2.aspx你想执行一个永久重定向到http://hostname.com/website_folder/page1.aspx .这可以通过URL Mapping/Rewrite实现有几个approaches explained by Scott Guthrie,也检查How to specify url mappings in ASP.NET 4.0 when parameters are involved?
URL Mapping/Rewrite
approaches explained by Scott Guthrie
2条答案
按热度按时间mgdq6dx11#
尝试使用Response.Redirect(您的URL);在代码的后面页。
如果您想了解更多信息,请阅读此处http://support.microsoft.com/kb/307903
vptzau2j2#
我假设每当请求来到下面的URL
http://hostname.com/website_folder/folder1/folder2/page2.aspx
http://hostname.com/website_folder/folder1/folder2/folder3/page2.aspx
你想执行一个永久重定向到
http://hostname.com/website_folder/page1.aspx
.这可以通过
URL Mapping/Rewrite
实现有几个
approaches explained by Scott Guthrie
,也检查How to specify url mappings in ASP.NET 4.0 when parameters are involved?