0
、私は次のようにビューモデルを定義している:フォームのシリアライズの問題
public class TestModel : Test
{
public TestModel (Models.Test1 t1)
:base(t1)
{ }
public TestModel (Models.Test1 t1, Models.Test1 t2)
:base(t1,t2)
{ }
としてクラスのテストが定義されている
:TestModelをt1から結合フィールドを表示するには、私のビューで使用されている
public class Test
{
public Test(Models.Test1 t1)
{
//set the properties for t1
}
public Test(Models.Test1 t1, Models.Test1 t2)
:this(t1)
{
//set properties for t2
}
}
// properties for t1 and t2
}
そしてt2。私はこのようなフォームを送信する場合:
$('form').submit(function (evt) {
Save($(this).serialize(),
function() {
$('.loading').show();
},
function() {
alert('success');
});
});
$('a.save').click(function (evt) {
$(this).parents('form').submit();
});
- the controller action below is never hit.
[HttpPost]
public JsonResult Save(TestModel camp)
{
Helper.Save(camp);
return Json(JsonEnvelope.Success());
}
私はTestModelはテストから派生しているためシリアル化が機能していないと思います。どのようにこれを動作させるための任意の提案?