c# - ASP.NET MVC 3, how should I assign attributes with HtmlHelper.BeginForm? -
I have HTML attributes in the form created with ASP.NET MVC3 with the It is enforcing this way: h The easiest way to do this, so I'll be sad There is some easy way to do this, so I can cross the new { Id = "my-form"} Html.BeginForm's only argument? No, unless you write your own HTML support: and then: Unfortunately you can not use the name Html.BeginForm I want to assign, but it seems that I have to use surcharge
BeginForm (this HtmlHelper html helper, string action name, string controller name, formmath method, object HTML attributes)
Html.BeginForm (empty, blank, FormMethod.Post, new {id = "my-form"}) < / Code>
new {id = "my-form"} as
Html.BeginForm ?
public static class form extension {public static MvcForm MyBeginForm (This HtmlHelper htmlHelper, Object HTML Attitudes) {html html.backform (empty, blank, formMethod.Post, html content); }}
@using (HTML.MyBeginForm (new {id = "my-form"}) {...}
BeginForm because there is already a parameter in which the parameter represents
route value .
Comments
Post a Comment