routes.MapRoute(
"Customer_widget",
"customer/widget/{action}/{id}",
new { controller = "Customer_Widget", id = UrlParameter.Optional });
測試URL1:(沒有工作) customer/widget/contact_list/1-1004-SC-0-0-0-0-0-0-Supplier-Supplier----0-0-0-0-Year-Calendar-0-Home-0
測試URL2:(不工作)
customer/widget/contact_list/1-1004-SC-0-0-0-0-0-0-Supplier-Supplier--6%2f1%2f2013-7%2f6%2f2013--0-0-0-0-Year-Calendar-0-Home-0 (does not work)
我測試了上述兩個URL。第一個網址到達正確的位置。但第二個網址只是失去了它的方式... 我不知道是什麼原因造成了這個... 我認爲白天部分,6%2f1%2f2013-7%2f6%2f2013,導致一些問題,但我是不知道那是什麼。
CustomerController
public ActionResult Index(string id = null)
{
string temp = "~/customer/widget/contact_list/" + this.objURL.ToString();
return Redirect("~/customer/widget/contact_list/" + this.objURL.ToString());
}
Customer_WidgetController
public ActionResult Contact_list(string id = null)
{
return PartialView("_contact_list",Customer_Widget.Contact_list.Load(id, ref errors));
}
流CustomerController - >(由地圖路線)Customer_WidgetController