How do you use a mvc helper method to create a ajax.beginform?
for ex:
@helper AjaxForm(string action, string controller, object routevalues, AjaxOptions options, params MvcHtmlString[] fields)
{
// DOES NOT WORK
@using(Ajax.BeginForm(action, controller, routevalues, options))
{
foreach (var field in inputfields)
{
@field
}
}
}
I would like to use this field anywhere in my views like this
@helper AjaxForm("Action", "Controller", new {id = "1"}, new AjaxOptions())
Like this