路线:
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。第一个 URL 转到正确的位置。但是第二个 URL 只是迷路了……我不知道是什么原因造成的……我有点假设白天部分 6%2f1%2f2013-7%2f6%2f2013 会导致一些问题,但我不确定那是什么。
客户控制器
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