asp.net mvc - Passing model property to helper function in Razor VB -


i have following code:

@html.textboxfor(function(model) model.username) 

i have put code in helper function inside .vbhtml looks this:

@helper displaytextbox(modelelement [what???])     @html.textboxfor(function(model) modelelement) end helper 

and call functions so:

displaytextbox(model.username) 

but that doesn't work, textbox name becomes $vb$local_modelelement if declare string or object, , i've tried declare modelelement in helper function tproperty, got error saying "type 'tproperty' not defined".

coincidentally, works fine, actualmodel actual class name have model type:

@helper displaytextbox(modelelement system.linq.expressions.expression(of system.func(of actualmodel, string)))     @html.textboxfor(modelelement) end helper  displaytextbox(function(model) model.username) 

i want place function(model) statement inside helper function. possible? doing wrong?


Comments