Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi Every one,
Now i am developing a website, here i need to work with dropdown box. In that situation dropdown is loaded from DB but my problem is whenever dropdown is Binded or value selected, the page will be automatic Reloaded. other textbox and check values are Disappear. here i will again fill the textbox how to avoid page reload in my dropdown selection.
i hope you all understand my problem.
Posted

All you need to use UpdatePanel.
Here is a example

<form id="form1" runat="server">
<asp:scriptmanager runat="server" id="ScriptManager1" xmlns:asp="#unknown">
<asp:updatepanel runat="server" id="UpdatePanel1" xmlns:asp="#unknown">
<contenttemplate>
<asp:dropdownlist runat="server" id="DropDown1" autopostback="true">
<asp:listitem text="DropDown1Item1" value="DropDown1Value1">
<asp:listitem text="DropDown1Item2" value="DropDown1Value2">
<asp:listitem text="DropDown1Item3" value="DropDown1Value3">



</form>
 
Share this answer
 
You are obviously just learning ASP.NET. I recommend learning MVC instead, it's better.

If you set AutoPostback to false, your control won't cause a postback.
 
Share this answer
 
Set dropdown AutoPostBack to false

AutoPostBack="false"

<asp:DropDownList ID="DropDownList1" AutoPostBack="false" runat="server">
    </asp:DropDownList>
 
Share this answer
 
v2
Comments
srigates 19-Jun-13 2:35am    
thank u..

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