-1
A
回答
1
void Application_BeginRequest(object sender, EventArgs e)
{
// Get the current path
string CurrentURL = Request.Url.ToString();
// Condition
if (CurrentURL.Contains("HtmlResponce.aspx"))
{
HttpContext MyContext = HttpContext.Current;
// Re write here
MyContext.RewritePath("testPage.aspx");
}
}
我在Global.asax中试过这段代码。这个对我有用!
0
如果您在IIS 7.x中,你与URL重写模块2.0更好,从这里开始:http://learn.iis.net/page.aspx/664/using-url-rewrite-module-20/
以上几点发布到“老”技术的联系,在天回用的IIS6。
IIS 7.x的新选项更简单,更方便。
相关问题
- 1. 使用URL重写
- 2. 用RewriteRule使用url重写URL变量
- 3. 使用Tuckey URL重写
- 4. 使用web.config URL重写
- 5. URL重写使用的htaccess
- 6. Url使用htaccess重写
- 7. 使用.htaccess URL重写
- 8. 使用Mod Rewrite重写url?
- 9. 使用htaccess的URL重写
- 10. URL重写使用的.htaccess
- 11. 使用?在URL重写
- 12. 使用DSAPI重写URL
- 13. C#中的URL重写#
- 14. URL在Visual Studio重写C#
- 15. 在web.config中重写URL c#
- 16. 如何使用ASP.NET 4.0 URL重写来重写URL?
- 17. URL重写,使用友好的URL
- 18. 使用C#使用ASP.NET 3.5进行URL重写
- 19. URL重写/重定向/使用的.htaccess
- 20. URL重定向/使用.htaccess重写
- 21. 使用IIRF重写/重定向URL
- 22. 用.htaccess重写URL
- 23. 用NGINX重写URL
- 24. 禁用URL重写
- 25. 用.htaccess重写url
- 26. 扩展url重写/过滤url重写
- 27. 在IIS中重写URL并重写URL
- 28. Mod重写问题:用drupal重写url
- 29. 现代重写 - 重写URL
- 30. system.webServer /重写 - > URL重写
[检查](http://msdn.microsoft.com/en-us/library/ms972974.aspx) – HariHaran 2012-07-13 12:16:01
从whathaveyoutried.com没有运气 – Bisileesh 2012-07-13 12:24:21
我不想在web.config中重新写入URL。 – Bisileesh 2012-07-13 12:25:58