阅读背景:

ASP。NET MVC:在指定html属性时使用相同的表单进行添加和编辑?

来源:互联网 

I wish to use the same form for adding and editing records within a database using a partial view. I understand that this is fine as the standard Html.BeginForm automatically output the correct html depending on the action that is being used (Add / Edit). However, I need to out said form with some extra HTML attributes. There does not appear to be an overload that allows this to happen without also specifying the ACTION and CONTROLLER names. If I hardcode these then surely I cant use the same form for edit and add automatically?I wish to use the same form for adding and edit




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: