小编Roc*_*oC5的帖子

.Net MVC视图无法渲染

我有一个控制器列出如下:

//
// GET: /Customer/Details/5
public ActionResult Details(short id)
{
    ActionResult actionResult = null;

    if (HttpContext.User.IsInRole("Admin"))
    {
        // this is the logic that is getting executed
        YeagerTechWcfService.Customer cust = db.GetCustomerID(Convert.ToInt16(id));
        actionResult = View("Details", cust);           }
    else
    {
        HttpCookie cn = Request.Cookies["strCookieName"];
        if (cn != null)
        {
            YeagerTechWcfService.Customer cust = db.GetCustomerID(Convert.ToInt16(id));
            actionResult = View("Details", cust);
        }
        else
        {
            TempData["ErrCode"] = "CustView";
            actionResult = RedirectToAction("Index", "Home");
        }
    }

    return actionResult;
}
Run Code Online (Sandbox Code Playgroud)

我有一个View(ActionLink所在的位置),如下所示:

columns.Template(
    @<text>
    @Ajax.ActionLink("Detail", "Details", "Customer", new { id = item.CustomerID …
Run Code Online (Sandbox Code Playgroud)

asp.net-mvc-routing asp.net-mvc-3

1
推荐指数
1
解决办法
1281
查看次数

标签 统计

asp.net-mvc-3 ×1

asp.net-mvc-routing ×1