How can I pass data from an aspx page to an ascx modal popup?

Posted by Erick B on Stack Overflow See other posts from Stack Overflow or by Erick B
Published on 2008-08-15T20:01:23Z Indexed on 2010/04/18 9:43 UTC
Read the original article Hit count: 347

Filed under:
|
|

I'm fairly new to ASP.NET and trying to learn how things are done. I come from a C# background so the code-behind portion is easy, but thinking like a web developer is unfamiliar.

I have an aspx page that contains a grid of checkboxes. I have a button that is coded via a Button_Click event to collect a list of which rows are checked and create a session variable out of that list. The same button is referenced (via TargetControlID) by my ascx page's ModalPopupExtender which controls the panel on the ascx page.

When the button is clicked, the modal popup opens but the Button_Click event is never fired, so the modal doesn't get its session data.

Since the two pages are separate, I can't call the ModalPopupExtender from the aspx.cs code, I can't reach the list of checkboxes from the ascx.cs code, and I don't see a way to populate my session variable and then programmatically activate some other hidden button or control which will then open my modal popup.

Any thoughts?

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET