简体   繁体   中英

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>

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM