PDA

View Full Version : سوال: تبدیل کد به vb.net



ameysams
سه شنبه 29 شهریور 1390, 13:27 عصر
با سلام یه تکه کد #C دارم معادل او در vb.net چیست؟
<p>
Will you attend?
@Html.DropDownListFor(x => x.WillAttend, new[] {
new SelectListItem() {Text = "Yes, I'll be there", Value = bool.TrueString},
new SelectListItem() {Text = "No, I can't come", Value = bool.FalseString}
}, "Choose an option")
</p>

ameysams
سه شنبه 29 شهریور 1390, 17:44 عصر
یافتم:
<%: Html.DropDownListFor(Function(x) x.WillAttend, New List(Of SelectListItem) From _
{
New SelectListItem With {.Text = "Yes, I'll be there", .Value = Boolean.TrueString},
New SelectListItem With {.Text = "No, I can't come", .Value = Boolean.FalseString}
}, "Choose an option")%>