我在asp.net mvc中創建了一個詳細頁面。併爲這個示例問題工作,如堆棧url。 Replacement of a JPanel element without adding to the end of the panel?處理asp.net mvc中無效字符的url
在頂部URL 36003787是ID和替換對的一-JPanel的元件,而無需-添加到所述端的最面板是detalis頁的標題。 現在我不創建這個網址。我有一個generete網址calss。 但是,如果你將堆棧url更改爲Replacement of a JPanel element without adding to the end of the panel? *或。要麼 !等... 堆棧找到這個網址,然後刷新頁面,並刪除無效的字符。(回到真正的網址)。 但我的網址是http://localhost:11148/Content/GetContent/347/Samsung-apple它正確的工作。但我手動更改瀏覽器的地址欄url。或&等頁面刷新並且沒有在Content控制器中找到GetContent操作。 plase查看堆棧url並更改此設置。我需要這個secanario爲我的項目。
和我的路由配置代碼 公共靜態無效的RegisterRoutes(RouteCollection路線) { routes.IgnoreRoute( 「{}資源個.axd/{*} PATHINFO」);
routes.MapRoute(
name: "NewsTitleRoute",
url: "Content/GetContent/ContentId/{title}",
defaults: new
{
controller = "Content",
action = "GetContent",
id = UrlParameter.Optional,
title = UrlParameter.Optional
});
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
和控制器 公衆的ActionResult的getContent(INT內容識別,串標題) {...} 請幫助我。