Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
namespace MySweetApp
{
using System;
using System.Linq.Expressions;
using System.Text;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Html;
public static class FormHelpers
{
public static HtmlString FormField(this HtmlHelper helper, Expression<Func> func)
{
var result = new StringBuilder();
result.Append(@"<div>");
result.Append(helper.LabelFor(func, new { @class = "control-label" }));
result.Append(@"<div>");
result.Append(helper.EditorFor(func));
result.Append(@"</div></div>");
return new HtmlString(result.ToString());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.