I'm sorry, you're right I havent been very clear as to what I'm trying to accomplish. Let me see if I can explain it better:
1) I have a single aspx page with 5 button controls labelled Button1..Button5
2) The user must be logged in to the site in order to use these buttons. So when a button is pushed, if the user is NOT logged in, I would like to display a modalpopup allowing the user to:
A) Login by filling in fields and clicking on a button named loginButton
B) Register by filling in fields and clicking a button named registerButton
C) Cancel the operation and dismiss the popup using a button named cancelButton
What I have So Far:
I) The popup I will be displaying is a user control containing all the controls for logging in/registering
II) I can bind one modalpopupExtender to a single Button (Button1) as the targetcontrol and to my usercontrol as the popupcontrol.
III) I can handle the ResolveControl event of the modalPopupExtender to find the cancelCancel button on my usercontrol because there is only one.
IV) I have the logic to log users in and register them in the apporpriate server side click handlers of the login and register button respectively.
V) The user control (which is what gets popped up) contains and update panel so that all the server calls happen async so the popup isnt dismissed once these buttons are pressed and the server side logic is performed.
What I can't do:
a) Bind the modalPopupControl so that the popup appears when any of Button1..Button5 is pressed. A requirement however, is that each button must perform serverside code to check the current login status BEFORE opening the modalPopup if necessary
b) Allow the loginButton or the registerButton dismiss the popup dialoge once the user has correctly logged in or registered. Another requirement of course is that both these buttons must perform server side code to check that the information entered was correct/valid.
Current Temporary Solution:
I currently only have a solution for problem b which is to allow the loginButton and registerButton to perform a Response.Redirect('currentPageUserIsOn.aspx") at the end of the server side onClick handlers. Obviously this isnt ideal becuase the screen is refreshed.
I know that was a lot but if any one has any ideas for overcoming these issues, please let me know! Thanks!
-aloo