ModalPopupExtender & UserControl

B

Ben

hi -

In ASP.net C#, i'm trying to make a logon window i can easily use in
many pages.

So I added a user control that has the username/pwd fields and
'cancel' / 'logon' buttons. The code-behind of the 'logon' button
uses DirectoryServices to auth. If it fails, it just updates a label
with an error... if it succeeds I call a 'LogonDialogClosed()' method
on the parent page (using events/delegates) and then close the
modalpopupextender by using FindControl to locate the extender on the
parent, like so:

eventAuthenticated.DynamicInvoke();
ModalPopupExtender mpeParentPopupExtender =
(ModalPopupExtender)this.Parent.FindControl("ModalPopupExtender_" +
this.ClientID);
mpeParentPopupExtender.Hide();

It ALMOST works perfect. Popup opens fine... on auth error it updates
the label (with no refresh to main page) and popup stays in place...
on successful auth, it calls the parent webform LogonDialogClosed
function and if i debug i can see i get there... however, if i try to
update a control on the page it doesn't show (for example, update a
textbox). What i really want to do is take some action and reload a
gridview. I do have an UpdatePanel in the main form, and if i call
it's Update method the page refreshes, but then the modal background
stays and i can't click on anything.... why would that cause the Hide
method to fail?!? If i change the order i call things above it
doesn't help...

thanks for any advice!!
 
J

Jeff Johnson

In ASP.net C#, i'm trying to make a logon window i can easily use in
many pages.

This question doesn't really have anything to do with the C# language; it's
actually about ASP.NET. I therefore recommend you repost to an
ASP.NET-specific group.
 
B

Ben

This question doesn't really have anything to do with the C# language; it's
actually about ASP.NET. I therefore recommend you repost to an
ASP.NET-specific group.

ok, i will - thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top