c# - 在 ASP.NET MVC3 中如何查看请求?

标签 c# asp.net-mvc asp.net-mvc-3 httpwebrequest

我使用一个简单的路线作为

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/

相关文章:

asp.net-mvc-3 - MVC3 以弹出窗口形式查看

asp.net-mvc-3 - MvcSiteMap 提供程序性能问题

asp.net-mvc-3 - 复杂的验证场景

c# - 如何订购无序序列

c# - keyup 事件调用数据库函数并填充列表框

c# - XmlNodeConverter 只能转换以对象开头的JSON

c# - 在没有 @HTML.Beginform 的情况下发布表单并在 asp.net MVC 中使用 Jquery(ajax)

c# - 接口(interface) : simplified

c# - 运算符 '==' 不能应用于类型 T?

asp.net-mvc - Windows 身份验证网站提示 Firefox,但不提示 Internet Explorer