VB中匿名类型的语法是什么?(What is the syntax for an Anonymous type in VB?)

编程入门 行业动态 更新时间:2024-10-27 17:17:55
VB中匿名类型的语法是什么?(What is the syntax for an Anonymous type in VB?)

我想设置htmlAttribute属性,但我不能找出正确的语法

这里是它是如何工作在C#

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

什么是vb.net版本

new { style = "width:100px" }

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" }

?

最满意答案

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

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

如果你想声明一个匿名类型,使用下面的语法:

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

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" }

更多推荐

本文发布于:2023-04-27 21:51:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1328618.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:语法   类型   VB   type   Anonymous

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!