Button OnClick Method with ModalPopupExtender Issue

Last post 12-09-2007 2:30 PM by e_screw. 3 replies.

Sort Posts:

  • Hmm [^o)] Button OnClick Method with ModalPopupExtender Issue

    12-08-2007, 8:08 PM
    • Member
      27 point Member
    • gulrnpink
    • Member since 11-26-2007, 1:00 PM
    • Posts 100

    I am having problems with my button's onclick method not working.  This button triggers a modalpopupextender to open.  Is the OnClick method of a button control disabled when it is linked to a modalpopupextender?  Thanks.

  • Re: Button OnClick Method with ModalPopupExtender Issue

    12-09-2007, 12:25 AM
    • All-Star
      19,498 point All-Star
    • e_screw
    • Member since 10-20-2004, 9:22 AM
    • Women, Guitar, Russia, Billiards, Nature, .NET
    • Posts 3,893

    Can you post your code?

    Thanks

    Mark post(s) as "Answer" that helped you

    Electronic Screw
    Website||Blog||Dub@i.net
  • Re: Button OnClick Method with ModalPopupExtender Issue

    12-09-2007, 1:30 AM

    Yes, it is "disabled".  If you want to execute code in addition to showing the modalpopup, simply delete the TargetControlID from the ModalPopupExtender.  In the button's click event, use the .Show() method of the ModalPopupExtender to show it instead.  The same can be implemented for hiding the popup.  The extender has a server-side .Hide() method.

    When you ask a question, remember to click "mark as answered" when you get a reply which answers your question.


    My latest ASP.NET AJAX blog entries.
  • Re: Button OnClick Method with ModalPopupExtender Issue

    12-09-2007, 2:30 PM
    Answer
    • All-Star
      19,498 point All-Star
    • e_screw
    • Member since 10-20-2004, 9:22 AM
    • Women, Guitar, Russia, Billiards, Nature, .NET
    • Posts 3,893

    DisturbedBuddha:
    simply delete the TargetControlID from the ModalPopupExtender

    The TargetControlID of ModalPopupExtender cannot be null or empty. Instead, you can set the display style to none, and call the Show() method in the desired event.

    Edited

    You can also check my article about this at http://www.aspalliance.com/1509

    Thanks

    -Mark post(s) as "Answer" that helped you

    Mark post(s) as "Answer" that helped you

    Electronic Screw
    Website||Blog||Dub@i.net
Page 1 of 1 (4 items)