views:

513

answers:

2

Name:
<%= Html.TextBox("txtName", "20", new { @class = "hello" }) %>

I want that in VB.NET , is it .cssclass="hello" or is it something else?

+2  A: 

This works:

<%=Html.TextBox("TextName", "TextBox value", New With {.class = "theClass"})%>
Patricia
A: 

You need to use the "With" keyword, and a dot, as follows:

<%= Html.TextBox("txtName", "20", New With { .class = "hello" }) %>

Travis Laborde
doh! beat by 45 seconds? /sigh
Travis Laborde