這不是重複的線程。 我的情況是發送沒有模型的數組參數。但其他線程是發送int,字符串參數個體。是否有沒有模型的數組後表單的方法?
我知道如何發佈與模型對象控制器。
但有時我想模型db和崗位格式對象或數組 之外發布的數據我怎麼能這樣做?
查看
<form action="/home/showdata" method="post">
<input type="text" name="arr.username" />
<input type="text" name="arr.password" />
<input type="text" name="arr.email" />
</form>
控制器
public class HomeController : Controller
{
[HttpPost]
public ActionResult ShowData(Array data)
{
return Content(data.username + data.password + data.email);
}
}
爲什麼你要做到這一點沒有一個模式? – DavidG
,因爲有些字段不在數據庫表中。 –
數據庫與這裏發佈的模型有什麼關係? – DavidG