Runat = Server
I am a newbee of .NET C#. I've coded as below:
<form action="second.aspx" method="post">
<P>What Martial Art do you like?
<asp:radiobuttonlist id="radio1" runat="server">
<asp:listitem value="Capoeira"/>
<asp:listitem value="Shaolin"/>
<asp:listitem value="JKD"/>
</asp:radiobuttonlist>
</P>
<P><input type="submit" value="Submit"></P>
</form>
According to "Beginning ASP.NET using C#" page 131 said, no need to put "runat=server" at "<form>", but the page totally can't be loaded and errors have come out: "Control 'radio1_0' of type 'RadioButton' must be placed inside a form tag with runat=server."...
Could anyone tell me what's wrong?
|