0

这是调用视图的控制器方法:

[HttpGet]
        public ActionResult Edit(int? paramid)
        {
            var document = documentRepository.DocumentsWithEmpty.FirstOrDefault(c => c.ID == paramid.Value);
            RC rc = new RC(document);
            return View("RC", rc);
        }

这是视图(目前很空)

@model RC

@{
    Layout = null;
}
@using (Html.BeginForm()) //I've also tried by specifying the method/controller/param
{
   //I've also tried with some @Html.EditorFor items
}

以及控制器中的方法来捕捉发布的RC

[HttpPost]
public ActionResult Edit(RC rc) //If I put no parameter, it gets called correctly
{
    throw new Exception("x");
}

它是唯一不能正常工作的实体/地方。可能是因为 RC 不是我数据库中的实体吗?

Firebug 将这些用于 GET 和 POST 请求(POST 请求为红色)。很简单

http://localhost:58136/Documents/Edit/23?_=1351197746968
4

0 回答 0