Click here to Skip to main content
15,892,643 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am developing my asp.net website, my requirement is to refresh DropDownList2 at SelectedIndexChanged event of DropDownList1, I have set
C#
AutoPostBack="True"
for DropDownList1. Now the problem is whole web page gets refreshed, its unnecessary for me, is there any other technique that i can use to refresh only that control or only that panel rather than refreshing whole page?
Posted
Updated 30-Jan-12 23:53pm
v2
Comments
saini arun 31-Jan-12 5:07am    
If both the drop downs have items at the time of page load, you can do it using javascript.
If the items in the second drop down depends upon the item selected in the first one, then you have to use ajax.
PATEL RAJEEV 31-Jan-12 5:10am    
Sorry i don't know how to use ajax.
p/z help me.
saini arun 31-Jan-12 6:16am    
See the solution posted by maheshkumar.adarsh below. You just need to place your drop downs in between contentTemplate tags.
Anuja Pawar Indore 31-Jan-12 5:54am    
Removed extra pre tag

Write the code between this

XML
<asp:ScriptManager ID="ScriptManager1" runat="server" />
       <asp:UpdatePanel runat="server" id="UpdatePanel" updatemode="Conditional">

           <ContentTemplate>

           </ContentTemplate>
             <Triggers>
         <asp:Asyncpostbacktrigger controlid="DropDownList2" eventname="SelectedIndexChanged" />
       </Triggers>
       </asp:UpdatePanel>
 
Share this answer
 
v2
Comments
Member 10409158 24-Jan-15 9:58am    
it doesn't work

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