c# - need of Expression in InputExtensions.TextBoxFor -
method syntax:
public static mvchtmlstring textboxfor<tmodel, tproperty>( htmlhelper<tmodel> htmlhelper, expression<func<tmodel, tproperty>> expression ) implementation code:
your name: <%: html.textboxfor(x => x.name) %> what need of expression's instance in textboxfor or lablefor first argument? cant implemented in other way? role expression playing here?
using html.textboxfor applies function each textbox apply title it. why have specify function (in case, lambda). need have viewmodel in order use it.
if want avoid using function, can use plain old html.textbox, don't fancy binding comes textboxfor free. adds html textbox page.
Comments
Post a Comment