-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