Hey guys,
Forgive me if this was answered elsewhere; I couldn't find it.
I am trying to add a standard RadioButtonList as a child control to a panel item. "pbarForm" was added at design-time to the aspx page
The page loads fine and the radio buttons show up fine, but when I click the radio buttons, it postsback and then the page is rendered without the radiobutton list.
Not sure why this is happening.
Below is my aspx page:
Thank you in advance,
Caesar
Forgive me if this was answered elsewhere; I couldn't find it.
I am trying to add a standard RadioButtonList as a child control to a panel item. "pbarForm" was added at design-time to the aspx page
| Page_Load(){ |
| if(!IsPostBack){ |
| RadPanelItem pi = new RadPanelItem();; |
| pi.EnableViewState=true; |
| pi.Text = "Panel"; |
| pbarForm.Items.Add(pi); |
| RadioButtonList rbl = new RadioButtonList(); |
| rbl.AutoPostBack = true; |
| rbl.EnableViewState = true; |
| rbl.Items.Add("1"); |
| rbl.Items.Add("2"); rbl.SelectedIndexChanged+= new EventHandler(rbl_SelectedIndexChanged); |
| pi.Controls.Add(rbl); |
| } |
| } |
The page loads fine and the radio buttons show up fine, but when I click the radio buttons, it postsback and then the page is rendered without the radiobutton list.
Not sure why this is happening.
Below is my aspx page:
| <form id="form1" runat="server"> |
| <telerik:RadScriptManager id="RadScriptManager1" runat="server"> |
| </telerik:RadScriptManager> |
| <telerik: RadAjaxPanel id="RadAjaxPanel1" runat="server"> |
| <div> |
| <telerik:RadPanelBar ID="pbarForm" runat="server"> |
| </telerik:RadPanelBar> |
| </div> |
| </telerik:RadAjaxPanel> |
| </form> |
Thank you in advance,
Caesar