In this blog you will find ASP.NET 3.5 articles and some code samples. These code samples are created by me and should be working. Thanks for visiting my blog! Happy Dot Netting

Tuesday, July 22, 2008

RadioButtonList control - Array binding

Script that builds the list and binds the values in the list to the RadioButtonList control

Sub Page_Load
if Not Page.IsPostBack then
  dim mycountries=New ArrayList
  mycountries.Add("Norway")
  mycountries.Add("Sweden")
  mycountries.Add("France")
  mycountries.Add("Italy")
  mycountries.TrimToSize()
  mycountries.Sort()
  rb.DataSource=mycountries
  rb.DataBind()
end if
end sub


In ASPX page add a radio control and see if properties are as mentioned below
asp:RadioButtonList id="rb" runat="server" 

No comments: