如果你将匿名物体退回控制员,则通过查阅匿名物体财产名称来掩饰控制者的论点,那么,我如何将相关物体的特性退回到我的模型中,以便违约价值对控制者具有约束力?
For example:
Model:
public class MyViewModel
{
public MyItem MyItem { get; set; }
}
public class MyItem
{
public string Name { get; set; }
}
Controller:
public ActionResult Index(MyViewModel model)
{
return View(model);
}
In the view, I want to pass the MyItem.Name back, how is this possible? I have tried:
@Html.ActionLinke("Index", "MyController", new { name = "example" })
and
@Html.ActionLinke("Index", "MyController", new { myItem_Name = "example" })
Help please!