Click here to Skip to main content
15,909,741 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I have two radio buttons associated with different controls..one with a checked list box and other with a text box. To handle the radio buttons in AJAX, I placed them inside update panel. Overall I placed a table with 2 radio buttons, 1 checked list box, 1 textbox and 2 buttons inside updatepanel. With this approach the radio buttons are working well, but the normal buttons stopped working.

Please find the code below:
XML
<asp:Panel ID="SelectAttributesPanel" runat="server" Width="230px" BackColor="#F0F8FF" BorderColor="Black" BorderWidth="1" Font-Names="Verdana" Font-Size="X-Small" onprerender="SelectAttributesPanel_PreRender">
 <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
 <ContentTemplate>
 <table style="width: 114%; color: #000000;">
 <tr bgcolor="#00CCFF"><td align="left" valign="middle">
 <asp:RadioButton ID="rdSelectAttribs" runat="server" AutoPostBack="True"
Text="Display Exploded View Graph based on the attributes selected below" GroupName="CHOICE" Font-Bold="True" Font-Names="verdana" ForeColor="White" Checked="True" Font-Size="Small" oncheckedchanged="rdSelectAttribs_CheckedChanged" />
</td></tr> <tr><td align="left" valign="middle">
 <asp:CheckBoxList ID="chklstAttributes" runat="server" Font-Names="Verdana" Font-Size="X-Small">
 </asp:CheckBoxList>
</td></tr> <tr bgcolor="#00CCFF"><td align="left" valign="middle">
 <asp:RadioButton ID="rdBaseline" runat="server" AutoPostBack="True"
Text="Display Exploded View Graph based on the RNC Count" GroupName="CHOICE" Font-Bold="True" Font-Names="verdana" ForeColor="White" Font-Size="Small" oncheckedchanged="rdSelectAttribs_CheckedChanged" />
 </td></tr>
<tr><td align="left" valign="middle" style="font-family: verdana; font-size: small;">RNC Count Baseline&nbsp;
 <asp:TextBox ID="txtRNCCountBaseline" runat="server" onKeyPress="return numbersonly(event, false)"
 BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="X-Small" MaxLength="3" Width="26px" EnableViewState="False">50</asp:TextBox></td></tr> <tr><td align="center">
 <asp:Button ID="btnOKSelectAttributes" runat="server" Text="OK" BorderStyle="Solid" BorderWidth="1px"
Font-Bold="True" Font-Size="Small" EnableViewState="False" onclick="btnOKSelectAttributes_Click" CausesValidation="False" Font-Names="verdana" />&nbsp; <asp:Button ID="btnCancelSelectAttributes" runat="server" Text="Close" Font-Bold="True" Font-Size="Small" EnableViewState="False" BorderStyle="Solid" BorderWidth="1px" Font-Names="verdana" />
 </td></tr>
 </table>
 </ContentTemplate>
 <Triggers>
 <asp:AsyncPostBackTrigger ControlID="rdSelectAttribs" EventName="CheckedChanged" />
 <asp:AsyncPostBackTrigger ControlID="rdBaseline" EventName="CheckedChanged" />
 </Triggers>
 </asp:UpdatePanel> </asp:Panel>


In the radio button checked changed events, I enable/disable the checkedlistbox and textbox. They are working fine. But the Ok and Close button events are not firing. What is the problem??
Posted
Updated 15-Nov-10 17:04pm
v2
Comments
Sunasara Imdadhusen 15-Nov-10 23:04pm    
Please place your code in proper PRE tag format

Thank you for your reply.
I got it working by placing the OK and Cancel buttons in separate UpdatePanels. But, I still could not understand why it did not work in a single UpdatePanel.
 
Share this answer
 
Hi,
I don't see any event for your close button. However the error is you need to add ok/close button event under trigger, other wise update panel wont response accordingly. Your trigger code should look like this
XML
<Triggers>
<asp:AsyncPostBackTrigger ControlID="rdSelectAttribs" EventName="CheckedChanged" />
<asp:AsyncPostBackTrigger ControlID="rdBaseline" EventName="CheckedChanged" />
<asp:AsyncPostBackTrigger ControlID="btnOKSelectAttributes" EventName="Click" />
<asp:AsyncPostBackTrigger ControlID="btnCancelSelectAttributes" EventName="Click" />
 </Triggers>




Hope this will help
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900