Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OnSelectedIndexChanged not firing

Status
Not open for further replies.

NuJoizey

MIS
Aug 16, 2006
450
US
I have a nested repeater situation that looks something like this (simplified) :

repeater1
repeater2
gridview
templatefield
dropdown
/template field
/gridview
/repeater2
/repeater1

I am trying to capture OnSelectedIndexChanged of the dropdown, but when I run it thru the debugger, the event never fires at all, and the idea was to write code that makes updates to a database based on this event.

I made sure AutoPostBack="true" on the dropdown, and I also know that other events of the dropdown, such as "OnLoad" are firing, because I have code running off of that event. It just seems that OnSelectedIndex never ever happens.

What the heck is going on?
 
the problem was in fact related to postback and databinding.

I was able to resolve the problem by moving some of the code that builds my UI screen from page_load to page_init. some of my page_load seemed to be causing that event not to fire. It seems to work now.

I found that this post helped flip the switch on in my mind about what to look for and what might be happening.

Although I wasn't experiencing exactly the same issues, it helped me derive the answer. I hope this may help someone else.
 
If you had mentioned that you were building some controls dynamically, we might have been able to help you.
 
sorry - often times i'm not sure exactly how to frame some of these questions. also, i'm not building controls dynamically the way that guy was. I still haven't totally solved this issue so that it works as I intended, but at least I know why it's happening. Now if i could just fix the gosh darn thing.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top