Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Friends,
I have written a following code in my aspx page:
<asp:UpdatePanel runat="server" id="HoodUpdatePane" updatemode="Conditional">
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="RBLstSeries" EventName="SelectedIndexChanged"/>
                </Triggers>
                <ContentTemplate>
                <asp:RadioButtonList ID="RBLstSeries" runat="server" onselectedindexchanged="RBLstSeries_SelectedIndexChanged">
                <asp:ListItem Text="ELXC" Value="ELXC" Enabled="false"></asp:ListItem>
                <asp:ListItem Text="ELXC-UVi" Value="ELXC-UVi" Enabled="false"></asp:ListItem>
                <asp:ListItem Text="ELX" Value="ELX" Enabled="true" Selected="True"></asp:ListItem>
                <asp:ListItem Text="ELX-UVi" Value="ELX-UVi" Enabled="false"></asp:ListItem>
                <asp:ListItem Text="PG" Value="PG" Enabled="false"></asp:ListItem>
                <asp:ListItem Text="VH2" Value="VH2"></asp:ListItem>
                </asp:RadioButtonList>
                </ContentTemplate>
                </asp:UpdatePanel>


but still on radio button click whole page post back..I m using AJAX first time,plz help...anything else has to be added in code?
Posted
Updated 12-Apr-12 1:49am
v2
Comments
Nilesh Patil Kolhapur 12-Apr-12 8:53am    
set autopostback=true of radiobuttonlist

Hey,

set AutoPostback property true of ur RBLstSeries
or replace ur code by following

XML
<asp:UpdatePanel runat="server" ID="HoodUpdatePane" UpdateMode="Conditional">

       <ContentTemplate>
           <asp:RadioButtonList ID="RBLstSeries" runat="server" AutoPostBack="True"
               onselectedindexchanged="RBLstSeries_SelectedIndexChanged" >
               <asp:ListItem Text="ELXC" Value="ELXC" Enabled="false"></asp:ListItem>
               <asp:ListItem Text="ELXC-UVi" Value="ELXC-UVi" Enabled="false"></asp:ListItem>
               <asp:ListItem Text="ELX" Value="ELX" Enabled="true" Selected="True"></asp:ListItem>
               <asp:ListItem Text="ELX-UVi" Value="ELX-UVi" Enabled="false"></asp:ListItem>
               <asp:ListItem Text="PG" Value="PG" Enabled="false"></asp:ListItem>
               <asp:ListItem Text="VH2" Value="VH2"></asp:ListItem>
           </asp:RadioButtonList>
           <br />
           <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
       </ContentTemplate>
   </asp:UpdatePanel>


and in aspx.cs page add following event

C#
protected void RBLstSeries_SelectedIndexChanged(object sender, EventArgs e)
   {
       Label1.Text = "Post back Done";
   }

hope ur problem is solved
best Luck
happy coding
 
Share this answer
 
v2
Comments
HexVijay 17-Apr-12 3:09am    
Thank u very much Nilesh...It works fine...
RBLstSeries is a child of the UpdatePanel, you don't need to add AsyncPostBackTrigger for it. Set ChildrenAsTriggers=true on the UpdatePanel.
 
Share this answer
 
Comments
HexVijay 12-Apr-12 7:58am    
I have removed
<Triggers>
<asp:AsyncPostBackTrigger ControlID="RBLstSeries" EventName="SelectedIndexChanged"/>
</Triggers>
but still it is post back page, I havent written any code in .cs page or I have set AutoPostBack=True for RBTNList?
Please check the browser in which you are executing your page.Google chrome wont support Ajax.

Thanks,

Ashish
 
Share this answer
 
Comments
HexVijay 12-Apr-12 8:24am    
I m executing in IE8
XML
<asp:UpdatePanel runat="server" id="HoodUpdatePane">                                 
<ContentTemplate>
                <asp:RadioButtonList ID="RBLstSeries" runat="server" onselectedindexchanged="RBLstSeries_SelectedIndexChanged">
                <asp:ListItem Text="ELXC" Value="ELXC" Enabled="false"></asp:ListItem>
                <asp:ListItem Text="ELXC-UVi" Value="ELXC-UVi" Enabled="false"></asp:ListItem>
                <asp:ListItem Text="ELX" Value="ELX" Enabled="true" Selected="True"></asp:ListItem>
                <asp:ListItem Text="ELX-UVi" Value="ELX-UVi" Enabled="false"></asp:ListItem>
                <asp:ListItem Text="PG" Value="PG" Enabled="false"></asp:ListItem>
                <asp:ListItem Text="VH2" Value="VH2"></asp:ListItem>
                </asp:RadioButtonList>
                </ContentTemplate>
                </asp:UpdatePanel>



can you try above ..
did you created AjaxEnabledWebsite ????
 
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