Nuyan
Nuyan

Reputation: 31

Why RadioButton not working in ajax and updatepanel used asp C#

I am using ajax control and update panel on this page. I have already given a trigger on this page inside the update panel. when I debugging this page ,if I click on the radio button named Rbfresh ,I don't get any value result from RbFresh and didn't go to RbFresh_CheckedChanged event. so my code could not work. Its my problem on this code.A panel included this page is visible based on the value come from these Rbfresh.

 <asp:UpdatePanel ID="updatepanel1" runat="server" UpdateMode="Conditional" >
 <ContentTemplate>
 <div>
 <ajaxToolkit:ToolkitScriptManager runat="server" ID="ToolkitScriptManager1">
 </ajaxToolkit:ToolkitScriptManager>
  <tr>
     <td align="left" class="style2">
      </td>
      <td align="left" dir="ltr" class="style2">                                 
      <asp:RadioButton ID="RbFresh"  runat="server" Text="Fresher"Width="60px" 
        GroupName="e" oncheckedchanged="RbFresh_CheckedChanged" />                                                                
      <asp:RadioButton ID="RbExp" runat="server" Width="60px" Text="Experienced" 
       GroupName="e" oncheckedchanged="RbExp_CheckedChanged" />
      </td>
      <td align="left" dir="ltr" class="style2">
       </td>
      </tr>
      </div>
   </ContentTemplate>
   <Triggers>
    <asp:PostBackTrigger ControlID="Rbfresh"  />                              
    </Triggers>
     </asp:UpdatePanel>

Upvotes: 0

Views: 536

Answers (1)

Genish Parvadia
Genish Parvadia

Reputation: 1455

use this code. AutoPostBack="True"

<asp:UpdatePanel ID="updatepanel1" runat="server" UpdateMode="Conditional" >
 <ContentTemplate>
 <div>
 <ajaxToolkit:ToolkitScriptManager runat="server" ID="ToolkitScriptManager1">
 </ajaxToolkit:ToolkitScriptManager>
  <tr>
     <td align="left" class="style2">
      </td>
      <td align="left" dir="ltr" class="style2">                                 
      <asp:RadioButton ID="RbFresh"  runat="server" Text="Fresher"Width="60px"/>                                                                 GroupName="e" oncheckedchanged="RbFresh_CheckedChanged"/>
      <asp:RadioButton AutoPostBack="True" ID="RbExp" runat="server" Width="60px" Text="Experienced" 
       GroupName="e" oncheckedchanged="RbExp_CheckedChanged" />
      </td>
      <td align="left" dir="ltr" class="style2">
       </td>
      </tr>
      </div>
   </ContentTemplate>
   <Triggers>
    <asp:PostBackTrigger ControlID="RbExp"  />                              
    </Triggers>
     </asp:UpdatePanel>

Upvotes: 1

Related Questions