Click here to Skip to main content
15,907,497 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my web application there are some DropDownList. I use selectedindexchanged event for every dropdownlist. but only a single dropdownlist creates problem. it's selected index changed event not fired and also when i try to select an item, it select it's default value.

AutoPostBack and ViewState enabled

don't understand what to do.
Posted
Updated 22-Jun-13 18:54pm
v2
Comments
KK Kod 23-Jun-13 1:00am    
please post the code behind and the event
Dipankar Basu 23-Jun-13 1:08am    
protected void ddlProSupplier_SelectedIndexChanged(object sender, EventArgs e)
{
if (Convert.ToInt32(ddlProSupplier.SelectedValue) != 0)
{
hdfSupplierCode.Value = SupplierManager.retrieve("[dbo].[Proc_Retrieve_AllSupplier]", Convert.ToInt32(ddlProSupplier.SelectedValue)).Code.ToString();

create_barcode();
}

}
KK Kod 23-Jun-13 1:16am    
please post the ddl from your page source too
Dipankar Basu 23-Jun-13 1:18am    
<asp:DropDownList ID="ddlProSupplier" runat="server" AutoPostBack="true" CssClass="dropdownlist" OnSelectedIndexChanged="ddlProSupplier_SelectedIndexChanged">
Mahesh Bailwal 23-Jun-13 1:56am    
Can you share where you are binding data with ddl. In PageLoad, if yes, is it inside if(!IsPostBack) condition?

Please make sure your not binding your ddl data in every post back inside Page_Load. Put your binding logic inside if(!IsPostBack)

if(!IsPostBack)
{
//bind your ddl here
}
 
Share this answer
 
I too got same problem,you solved it.thanks Bro.
 
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