Click here to Skip to main content
16,011,947 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to display message in label on changed event of dropdownlist..
but when i select dropdown value then it goes to change event but it takes by default value...so plz help me...
Posted
Comments
N ManojKumar 20-Mar-13 6:08am    
Have you checked your page_load method contains any (!IsPostBack) property?

1 solution

This is happening just because you bound your dropdownlist in Page_Load event directly. Try binding your DropDownList like this:
C#
protected void Page_Load(object sender, EventArgs e) 
{
    if(!IsPostBack)
    {
        DropDown1.DataSource = YourDataSource;
        DropDown1.DataTextField = "YourDataTextField";
        DropDown1.DataValueField = "YourDataValueField";
        DropDown1.DataBind();
    }
}



--Amit
 
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