我使用一个简单的路线作为
routes.MapRoute(
"Default2", // Route name
"{cliurl}/{id}", // URL with parameters
new { cliurl = "none", controller = "ABook", action = "Index", id = "none" } // Parameter defaults
);
routes.MapRoute(
"Default", // Route name
"{cliurl}/{controller}/{action}/{id}", // URL with parameters
new { cliurl = "none", controller = "ABook", action = "Index", id = "none" } // Parameter defaults
);
当我调试网站(VS2010 SP1)时,我的 ABook
Controller 中有一个断点,在 Index
操作方法中仅包含:
//
// GET: /ABook/
public ActionResult Index()
{
if (currentClient == null)
return RedirectToAction("Empty");
return View();
}
//
// GET: /Empty/
public ActionResult Empty()
{
return View();
}
问题是,当我将其插入浏览器时:
http://localhost:14951/client_name/hashed_id
我在该断点处中断了 3 次。
我怎样才能看到世界上正在发生什么?为什么我只请求1次却是3次,浏览器到底请求什么?
我只能获取路由参数,并且第一个参数正确,但第二个和第三个参数使用默认值,我尝试在 RequestContext
中导航,但看不到任何内容有用:(
Just want to know if there is a way to really see what's been requested.
最佳答案
关于c# - 在 ASP.NET MVC3 中如何查看请求?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5632182/