show modalPopupExtender panel after codebehind executed?

Last post 07-31-2008 3:08 PM by mabellez. 6 replies.

Sort Posts:

  • show modalPopupExtender panel after codebehind executed?

    07-31-2008, 1:42 PM
    • Member
      164 point Member
    • mabellez
    • Member since 03-31-2008, 11:02 AM
    • Posts 296

    I wonder if I can let the modalPopupExtender's panel to be poped up after some C# code was executed?

    Here my panel consist some textboxes and I need the data to be filled in before it was pop up.

    I tried to set the modalPopupExtender to disabled first and enable it in C# code after the C# code was executed, but the panel won't pop up, only if I click the targetControlbutton again, the panel will pop up.

    Any ideas?

  • Re: show modalPopupExtender panel after codebehind executed?

    07-31-2008, 2:04 PM
    Answer
    • Participant
      1,607 point Participant
    • eseidel
    • Member since 10-17-2006, 2:03 PM
    • Indianapolis, Indiana
    • Posts 504

    You have to trick the modalpopup.  First, create an asp:button with css style display:none, so <asp:button id="hButton" runat="server" style="display:none;" />.  Dont use Visible=false because then it wont be rendered at all and the modalpopup wont be able to see it and youll get funky errors.  It has to be display:none;

    then set that hidden button as the targetcontrol of the modalpopup.  Now you can just call .Show() and .Hide from code anywhere you want.

     

    Eric

  • Re: show modalPopupExtender panel after codebehind executed?

    07-31-2008, 2:28 PM
    • Member
      164 point Member
    • mabellez
    • Member since 03-31-2008, 11:02 AM
    • Posts 296

    Thank you Eric! do you mean to call hButton.show() in C#?

     

  • Re: show modalPopupExtender panel after codebehind executed?

    07-31-2008, 2:33 PM
    • Participant
      1,607 point Participant
    • eseidel
    • Member since 10-17-2006, 2:03 PM
    • Indianapolis, Indiana
    • Posts 504

    No, call the modalpopupexter.show

     

  • Re: show modalPopupExtender panel after codebehind executed?

    07-31-2008, 2:33 PM
    • Participant
      1,607 point Participant
    • eseidel
    • Member since 10-17-2006, 2:03 PM
    • Indianapolis, Indiana
    • Posts 504

    Call modalpopupID.show()

  • Re: show modalPopupExtender panel after codebehind executed?

    07-31-2008, 2:34 PM

    No, in the codebehind call YourModalPopup.Show();

  • Re: show modalPopupExtender panel after codebehind executed?

    07-31-2008, 3:08 PM
    • Member
      164 point Member
    • mabellez
    • Member since 03-31-2008, 11:02 AM
    • Posts 296

    Thank you~! works great~~~!!!!

Page 1 of 1 (7 items)