嘿,我想從一個友好的URL即刪除查詢字符串我有ASP.NET從友好的URL刪除查詢字符串
/who-we-are/our-people.html?linkidentifier=id&itemid=42
而且我想上面的改變,以
/who-we-are/our-people.html
如何在刪除任何東西后執行.html
嘿,我想從一個友好的URL即刪除查詢字符串我有ASP.NET從友好的URL刪除查詢字符串
/who-we-are/our-people.html?linkidentifier=id&itemid=42
而且我想上面的改變,以
/who-we-are/our-people.html
如何在刪除任何東西后執行.html
最快的方法是使用System.Uri
等級:
string pathOnly = new Uri("http://whatever.com/who-we-are/our-people.html?linkidentifier=id&itemid=42").AbsolutePath;
您需要進行URL重寫。
在這裏你可以找到更多關於這個click here
您需要使用Request
的Path
財產 - 這篇文章應該給你所需要的一切:做可靠Making Sense of ASP.NET Paths
我怎樣才能用'pathOnly'替換地址欄中的網址? – Nezam 2013-11-25 02:58:27