I can't seem to get the <asp:radiobuttonlist> control example to work.
The VS editor underlines the ID part of the <asp:listitem>. Only two default properties are displayed value and selected.
This statement is underlined <asp:listItem and the error message is :
"Within a server element asp:listItem is missing closing tag or ooverlaps with element "RadioButtonList"
And the ID element is underlined, it's error message is "Could not find attribute "id" of element ListItem.
Here is my code:
<%@ Page Language="
vb" %>
<script runat="server" language="
vb">
Sub Page_Load()
if Page.IsPostBack then
Message.Text = "You have selected " + radCity.SelectedItem.Value
end if
End Sub
</script>
<HTML>
<HEAD>
<title>TIO_RadioButtonList</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name=vs_defaultClientScript content="JavaScript">
<meta name=vs_targetSchema content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body>
<asp:label id="message" Runat="Server" />
<br /><br />
Which city interests you? <br /><br />
<form runat="server">
<asp:RadioButtonList ID ="radCity" Runat="server">
<asp:listItem id = "optMadrid" runat="server" value="Madrid " />
<asp:ListItem id ="optOslo" runat="server" value="Oslo" />
<asp:ListItem id ="optLisbon" runat="server" value="Lisbon" />
</asp:RadioButtonList><br />
<INPUT type="submit" >
</form>
</BODY>
</HTML>
Thanks,
gmann