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.

you can read on textbox here , textboxfor here


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -