Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


DropDownList doesn't generate a PostBack event 'OnSelectedIndexChanged'

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

I am writing a c# asp.net 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
  • 2
LVL 96

Expert Comment

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


Author Comment

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

Expert Comment

by:Bob Learned
ID: 19556043

        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

Michel Plungjan earned 2000 total points
ID: 19556785
what happens if you do

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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
While opting for any web-to-print solution, you need to discuss with your team and some of your end users and know their opinions about your decisions. In this article we list down some questions you need to ask yourself.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
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.
Suggested Courses

572 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