DropDownList doesn't generate a PostBack event 'OnSelectedIndexChanged'

Posted on 2007-07-24
Last Modified: 2008-02-01

I am writing a c# application. I have a page with a DropDownList with AutoPostBack set to 'true'.
There is a case where, on the client side, I reset the DropDownList from another page:
parent.frames[0].document.getElementById('ddlGroups').selectedIndex = 0;

after that, I can't select the previous item in the DropDownList anymore - the postback doesn't happen.
Is it because I have changed the index from the client side?
How can I fix that?

Maybe I should reset the DropDownList on the server side. If so, Is it possible to reference a control from a different page?

Question by:Relegence
    LVL 96

    Expert Comment

    by:Bob Learned
    If you are working with 2.0, there is the PreviousPage property that lets you access public properties on a page.


    Author Comment

    Can you please give an example of how to reference a control in another page using PreviousPage?
    LVL 96

    Expert Comment

    by:Bob Learned

            if (this.PreviousPage != null && this.PreviousPage.IsCrossPagePostBack)
                TextBox txt = (TextBox)this.PreviousPage.FindControl("TextBox1");

                if (txt != null)
                    this.TextBox1.Text = txt.Text;
                this.PopupWindow1.Visible = false;

    LVL 75

    Accepted Solution

    what happens if you do

    parent.frames[0].document.getElementById('ddlGroups').selectedIndex = 0;

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Introduction HyperText Transfer Protocol ( or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
    Using Quotation Marks in PHP This question ( seems to come up a lot for developers who are new to PHP.  And it got me thinking, "How can we explain the rule…
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
    Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

    729 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

    18 Experts available now in Live!

    Get 1:1 Help Now