Created
July 25, 2014 13:16
-
-
Save jbogard/fb93ff284d0630af99e3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static HtmlTag InputBlock<T>(this HtmlHelper<T> helper, | |
Expression<Func<T, object>> expression, | |
Action<HtmlTag> inputModifier = null, | |
Action<HtmlTag> validatorModifier = null) where T : class | |
{ | |
inputModifier = inputModifier ?? (_ => { }); | |
validatorModifier = validatorModifier ?? (_ => { }); | |
var divTag = new HtmlTag("div"); | |
divTag.AddClass("col-md-10"); | |
var inputTag = helper.Input(expression); | |
inputModifier(inputTag); | |
var validatorTag = helper.Validator(expression); | |
validatorModifier(validatorTag); | |
divTag.Append(inputTag); | |
divTag.Append(validatorTag); | |
return divTag; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment