【发布时间】:2015-01-19 19:03:54
【问题描述】:
如何使用 Html.BeginForm 在表单标题中添加匿名属性?比如我有:@using (Html.BeginForm("ProfileSetting", "Profile", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @string = "editable-form", @class = "form-horizontal", role = "form", name = "myform", onaftersave = "saveSettings()" }))
我希望呈现的 html 看起来像这样:<form editable-form action="" class"" method="" etc...></form>(我正在使用 Angularjs-xeditable)
这是我希望在 ASP.NET 中完成的示例的链接Angular-xeditable
【问题讨论】:
-
这被标记下来的任何原因?如果您需要更多详细信息,请告诉我。谢谢
-
我认为您不能使用匿名类型,因为您需要一个名为“可编辑表单”的属性,这是非法的。我的回答有用吗?
-
我还没有找到方法,也无法推断是否可以通过 html 帮助程序呈现匿名属性。到目前为止的所有迹象都表明这是不可行的
标签: c# asp.net forms asp.net-mvc-4