Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%= 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"); %>
- <body>
- <h1>RSVP</h1>
- <% 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[]
- {
- 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>
- <input type="submit" value="Submit RSVP" />
- <% } %>
- </body>
- <%
- Dim lst As New List(Of SelectListItem)
- Dim item1 As New SelectListItem
- item1.Text = "Yes, I'll be there"
- item1.Value = Boolean.TrueString
- lst.Add(item1)
- Dim item2 As New SelectListItem
- item2.Text = "No, I can't come"
- item2.Value = Boolean.FalseString
- lst.Add(item2)
- %>
- <%=Html.DropDownList("WillAttend", lst, "Choose an option")%>
- <% Dim listItems As 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} _
- }
- Response.Write(Html.DropDownList("WillAttend", listItems, "Choose an option"))
- %>
- <p>Will you attend?</p>
- <select id="WillAttend">
- <option>Select an option</option>
- <option value="true">Yes, I'll be there</option>
- <option value="false">No, I can't come</option>
- </select>
- <%: 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")%>
- <p>
- Will you attend?
- <%= Html.DropDownListFor(x => x.WillAttend, new[] {
- new SelectListItem { Text = "Yes, I'll be there",
- Value = bool.TrueString },
- new SelectListItem { Text = "Yes, I'll be there",
- Value = bool.FalseString }
- }, "Choose an option") %>
- </p>
Add Comment
Please, Sign In to add comment