What is the syntax for anonymous type in VB?

I am trying to set the htmlAttribute property but I cannot figure out the correct syntax

this is how it works in c #

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

      

what version of vb.net

new { style = "width:100px" }

      

?

+1


source to share


1 answer


The correct syntax for built-in 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" }

      

+6


source







All Articles