Multiple dynamically created web controls, one event handler
Hello all..
I have a table where one column has DropDownList controls. Rows are added dynamically using a LinkButton. Each new row creates a new DropDownList control. I have one SelectedIndexChanged event handler that I associated each DropDownList control with.
I recreate my table from cache on each postback.
The DropDownList controls do seem to call my SelectedIndexChanged event, but I cannot even assign text to a Label I have statically set on my web form. I also cannot use Response.Write in my event handler as I am told by ASP.NET that "Response is not available in this context". So I get a vague message that has no other useful information.
Is there something wrong with using numerous dynamically generated DropDownLists in a table column and a single even handler to handle all their SelectedIndexChanged events? Is there maybe some referencing issue with the DropDownLists?
Any help or advise would be appreciated. Thank you.
Replies
Know the answer? Post it — somebody with the same question will find it here.