1

我正在尝试设置 htmlAttribute 属性,但我无法找出正确的语法

这是它在 c# 中的工作方式

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

什么是 vb.net 版本

new { style = "width:100px" }

?

4

1 回答 1

6

VB 中内联匿名类型的正确语法是:

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

如果要声明匿名类型,请使用以下语法:

Dim myVariable = New With { .Style = "width:100px" }
于 2008-12-17T17:11:40.243 回答