views:

162

answers:

1

i am trying to set the htmlAttribute property but i cant figure out the correct syntax

here is how it works in c#

<%=Html.Password("myPassword", 50,"",new { style = "width:100px" })%><br />

what would be the vb.net version of

new { style = "width:100px" }

?

+4  A: 

The correct syntax for an inline anonymous type in VB is:

New With { .Style = "width:100px" }

If you want to declare an anonymous type use this syntax:

Dim myVariable = New With { .Style = "width:100px" }
Micah