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