S
Santel
Hi,
I tried to create a custom server control that displays some radio
buttons and it should postback the page on selecting the items. I
tried like below code, but on postback, the selected radio button
state is not maintained. Anyone could tell me what is missing?
public class WebCustomControl1 : RadioButtonList
{
protected override void Render(HtmlTextWriter output)
{
this.Items.Add(new ListItem("aaa"));
this.Items.Add(new ListItem("bbb"));
this.AutoPostBack = true;
base.Render(output);
}
}
I tried to create a custom server control that displays some radio
buttons and it should postback the page on selecting the items. I
tried like below code, but on postback, the selected radio button
state is not maintained. Anyone could tell me what is missing?
public class WebCustomControl1 : RadioButtonList
{
protected override void Render(HtmlTextWriter output)
{
this.Items.Add(new ListItem("aaa"));
this.Items.Add(new ListItem("bbb"));
this.AutoPostBack = true;
base.Render(output);
}
}