私はうまく動作するMVCアプリケーションを作成しました。今私はurlのカスタムキーを追加し、それらを解析したい、それはURLの1つのタイプのためだけに働いて、次のものではありません。Maprouteはプレフィックスで動作していませんか?
マイルートエントリは次のとおりです。
routes.MapRoute(null,"client_{client_key}",
new
{
controller = "templates", action = "contents_page"
});
routes.MapRoute(null,"client_{client_key}/{keyword}",
new
{
controller = "templates", action = "contents_pagen"
});
私のURL:
http://www.lmenaria.com/client_1
。http://www.lmenaria.com/client_2
。
上記のURLは正常です。
http://www.lmenaria.com/client_1/home.html
。http://www.lmenaria.com/client_2/home.html
。
URLの両タイプが動作していない、私はcontents_pagen
アクションのキーワードパラメータでhome.html
を取得しておりません。
私のアクション:
public ActionResult contents_pagen(string client_key, string keyword, FormCollection frmColl)
{
}
だから、私はそれを修正する方法を教えてください。