1
我試圖設置htmlAttribute屬性,但我不能找出正確的語法VB中Anonymous類型的語法是什麼?
這裏是它如何工作在C#
<%=Html.Password("myPassword", 50,"",new { style = "width:100px" })%><br />
會是什麼
new { style = "width:100px" }
的vb.net版
?
我試圖設置htmlAttribute屬性,但我不能找出正確的語法VB中Anonymous類型的語法是什麼?
這裏是它如何工作在C#
<%=Html.Password("myPassword", 50,"",new { style = "width:100px" })%><br />
會是什麼
new { style = "width:100px" }
的vb.net版
?
在VB中內嵌匿名類型正確的語法是:
New With { .Style = "width:100px" }
如果要聲明一個匿名類型使用的語法如下:
Dim myVariable = New With { .Style = "width:100px" }