I'm trying to make a dynamic radiobuttonlist for my site. I've found the code for it by googling and i get how its done, but i cant see to get my references working. I've added the System.Windows.Forms reference, and "using" at the top of the page. (some more googling told me that that was the appropriate reference) but i'm still getting this error message:
The type or namespace name `RadioButtonList' could not be found. Are you missing a using directive or an assembly reference?(CS0246)
Heres the code for the radiobuttonlist:
Expand|Select|Wrap|Line Numbers
- //create dynamic radiobuttonlist
- RadioButtonList rblTest = new RadioButtonList();
- rdoMoreRooms.ID = "rblTest";
- rdoMoreRooms.AutoPostBack = true;
- //rdoMoreRooms.SelectedIndexChanged += new System.EventHandler(this.radioButton_Check_Changed);
- rdoMoreRooms.RepeatDirection = RepeatDirection.Horizontal;
- rdoMoreRooms.Items.Add(new ListItem("Cake", "Cake"));
- phMoreRooms.Controls.Add(rblTest);
- phMoreRooms.Controls.Add(new LiteralControl("<p>"));