Capture dropdownlist value changed

Posted on 2012-08-24
Last Modified: 2012-08-24
Hi Experts,

I am working on ASP.NET 2.0 using C#

I wanted to update label whenever my value is dropdown list changed.

I have written code which is not working.

Please guide me with the issue


<asp:DropDownList ID="DropDownList1" runat="server" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">

<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>

Open in new window

protected void Page_Load(object sender, EventArgs e)


protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
	string str = DropDownList1.SelectedValue;

	Label1.Text = str;

Open in new window

Question by:tia_kamakshi
    LVL 20

    Accepted Solution

    OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" AutoPostback="true">

    Author Closing Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
    Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now