Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8031327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:04:11+00:00 2026-06-05T01:04:11+00:00

My setup is as follows: In the PageLoad event, I initialize a dropDownList as

  • 0

My setup is as follows:
In the PageLoad event, I initialize a dropDownList as follows:

SONumList = new DropDownList();
SONumList.DataSource = SOList;
SONumList.DataBind();
SONumList.Height = new Unit("19px");
SONumList.SelectedIndexChanged += (ChooseSODropDown);
SONumList.AutoPostBack = true;
Panel1.Controls.Add(SONumList);

In the ChooseSODropDown event that fires when the SelectedIndex on SONumList is changed, I create another DropDownList called PNum:

PNumList = new DropDownList();
PNumList.DataSource = dataSource2;
PNumList.DataTextField = "Part";
PNumList.DataValueField = "Part";
PNumList.DataBind();
PNumList.Height = new Unit("19px");
PNumList.SelectedIndexChanged += ChoosePNumDropDown;
PNumList.AutoPostBack = true;
Panel1.Controls.Add(PNumList);

Although the PNum box itself displays properly and has the data appropriately bound, the ChoosePNumDropDown event never fires, even though the page does postback. I’ve tried a breakpoint at the beginning of the function and it doesn’t fire at all.

Is there some reason why I would be unable to bind events to an object inside of another event firing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T01:04:14+00:00Added an answer on June 5, 2026 at 1:04 am

    The short answer is that by the time ChooseSODropDown has been fired, it’s too late to bind any more event handlers to existing controls. This is because the previous state of a control is deserialized from the viewstate within OnLoad, and that initial state is used to trigger an onchange event to be fired.

    I believe you’ll have to initialize all controls in OnLoad, including the event handler for ChoosePNumDropDown, and move any required logic into that event handler. To my knowledge, there is no way to add more event handlers within an existing event handler and expect it to be fired in the same postback.

    I’d recommend reading up in the Page Lifecycle to get acquainted with exactly how events are processed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class setup as follows: var oTest = new TEST(); function TEST()
I have a simple listview and listadapter setup as follows: listAdapter = new ArrayAdapter<MyDomainObject>(this,
I'm new to iPhone development. I have a game loop setup as follows. (void)CreateGameTick:(NSTimeInterval)
Our setup as follows: We have a local development server running Ubuntu, with a
The structure I'm trying to setup is as follows: /public_html repository (live) what the
I have a Pjs sketch, which looks as follows: void setup(){ //setup stuff among
Suppose I setup test2.js as follows module.exports.doPrint = doPrint; var dummy = initial; function
My CodeIgniter setup follows the usual scheme -- a user app, and a second
I have a setup as follows. A private repository at bitbucket where I keep
I have a MySQL table setup as follows: +---------------+-------------+------+-----+---------+----------------+ | Field | Type |

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.