How can you add a method on the clickevent of a cancelcontrolID of a ModalPopupExtender

Last post 11-10-2009 7:54 AM by MetalAsp.Net. 3 replies.

Sort Posts:

  • How can you add a method on the clickevent of a cancelcontrolID of a ModalPopupExtender

    11-10-2009, 5:24 AM
    • Member
      12 point Member
    • SilentStorm
    • Member since 05-27-2009, 8:01 AM
    • Posts 45
    I have a ModalPopUpExtender with a button as cancelcontrolID. I have added a method to the click of the the CancelControlID. But the method is never called. How can I fix this.
  • Re: How can you add a method on the clickevent of a cancelcontrolID of a ModalPopupExtender

    11-10-2009, 6:51 AM

    Remove it as the CancelControlID and you'll be set.

  • Re: How can you add a method on the clickevent of a cancelcontrolID of a ModalPopupExtender

    11-10-2009, 7:32 AM
    • Contributor
      6,712 point Contributor
    • alaa9jo
    • Member since 07-01-2009, 1:17 PM
    • Jordan
    • Posts 1,198

    MetalAsp.Net:
    Remove it as the CancelControlID and you'll be set.

    I agree with MetalAsp.Net and I want to extend his answer that you need to hide that modal manually from your code either by calling:

    yourmodalpopup.Hide();

    or

    using Javascript:

    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "hideModal", "$find('" + yourmodal.ClientID  + "').hide();", true);


    Best Regards,
    Ala'a Alnajjar
    ----------------------------------------------------
    Please remember to click “Mark as Answer” on the post(s) of the member(s) that help(s) you even if they were for the same person.
    Also remember to close the thread by selecting “Resolved”,you will find it in your first post.

    Convert C# to VB.net and visa versus
    My Webblog
  • Re: How can you add a method on the clickevent of a cancelcontrolID of a ModalPopupExtender

    11-10-2009, 7:54 AM
    Answer

    alaa9jo:

    ...you need to hide that modal manually from your code either by calling:

    yourmodalpopup.Hide();

     

     

    No, you don't need to.  Unless it's in an updatepanel, it will close by default.

Page 1 of 1 (4 items)