views:

19

answers:

1

I'm trying to create my own templated helpers but I got stuck on TextBoxFor syntax. In C# its:

<%= Html.TextBoxFor(model => model) %>  

And I cannot figure out (or google it) - how to write that in vb.net?

A: 

That looks like standard C# Lambda syntax, so the translation would be:

<%= Html.TextBoxFor( Function (model) model ) %> 

Basically you are giving Html.TextBoxFor a function with 1 parameter. That function doesn't do anything, it just echos the argument back to the caller.

This would require VB 10, which is found in Visual Studio 2010.

Jonathan Allen
Thanks, I kinda missed that - VB 10 part...
Vnuk
Just one small detail - since it is a function, it should be declared as such - Funcion(model) model
Vnuk
Yep. I don't know what I was thinking there.
Jonathan Allen