Asp – html helpers ASP.NET MVC DropDownList in .aspx in VB language

asp.netasp.net-mvc

There is very little code out there that is in VB, and i'm getting stuck all the time. Can someone tell me the VB equivalent of this C# code?

Thx…

<%= Html.DropDownList("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") %>

Best Answer

Thanks TV for pointing me in the right direction... I struggled with nutting the array Constructer Type in VB - It was right there all the time....

Robert's on page 26 of Steven Sanderson's great book, Pro ASP.NET MVC Framework.

Many thanks.

Gordon

<% Using Html.BeginForm()%>
    <p>Your name: <%=Html.TextBox("Name")%></p>
    <p>Your email: <%=Html.TextBox("Email")%></p>
    <p>Your phone: <%=Html.TextBox("Phone")%></p>
    <p>
        Will you attend?
        <%=Html.DropDownList("WillAttend", New SelectListItem() { _
           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")%>
    </p>
    <input  type="submit" value="Submit RSVP" /> 

<% End Using%>