ModalPopupExtender - can't change a control

Last post 02-09-2009 4:43 PM by Dev_001. 6 replies.

Sort Posts:

  • ModalPopupExtender - can't change a control

    02-06-2009, 11:42 AM
    • Member
      1 point Member
    • Dev_001
    • Member since 02-06-2009, 11:25 AM
    • Posts 4

    Hello,

    I try to modify  the text of a TextBox or Label in ModalPopuExtender :

     <cc1:ModalPopupExtender ID="mpe" runat="server" TargetControlID="btHIDE" PopupControlID="panelRecap"
    OkControlID="btOK" DropShadow="true" />
    <asp:Panel ID= "panel" runat="server" Style="display: table-header-group">
    <asp:Label ID="label" runat="server" Text="Summary :" />
    <asp:TextBox ID="tb" runat="server" TextMode="MultiLine"/>
    <asp:Button ID="btClose" runat="server" Text="Close" />
    </asp:Panel> 
    tb.Text="Thank you for your choice : (......)";
    mpe.Show();

     mpe.Show() works, the panel is visible like I want but I don't have my text. In debug mode, I can see the propertie is correctly assigned. Is it due of page's construction ?

    Thanks for your help

  • Re: ModalPopupExtender - can't change a control

    02-06-2009, 4:12 PM
    Answer
    • Member
      353 point Member
    • ForceMagic
    • Member since 04-02-2008, 7:05 PM
    • MainFrame
    • Posts 93

     Hello,

     First please include an Update Panel in your current Panel.

      

    <asp:Panel  ID= "panel" runat="server"  Style="display: table-header-group">
      <asp:UpdatePanel ID="upPanel" runat="server" UpdateMode="conditional">
          <ContentTemplate>
            <asp:Label  ID="label" runat="server" Text="Summary :" />
            <asp:TextBox ID="tb" runat="server" TextMode="MultiLine"/>
            <asp:Button ID="btClose" runat="server" Text="Close" />  
         </ContentTemplate>
       </asp:UpdatePanel>
    </asp:Panel> 
    
     

     And then use

    upPanel.Update()

    it should work :)

    ~ ForceMagic - Aleajecta Dev Team ~

    Please click “Mark as Answer” on the post that helps you, and click “Unmark as Answer” if a marked post does not actually answer your question.
  • Re: ModalPopupExtender - can't change a control

    02-08-2009, 3:19 PM
    • Member
      1 point Member
    • Dev_001
    • Member since 02-06-2009, 11:25 AM
    • Posts 4

     Hello,

     Tank you very much ! It works ! 

    Unfortunately for me, if I use your idea, my button who close the popup doesn't work : 

     
    <cc1:ModalPopupExtender ID="mpe" runat="server" TargetControlID="btHIDE" PopupControlID="panel"
    OkControlID="btOK" BackgroundCssClass="modalBackground" DropShadow="true" />
     
    Maybe you know why ?

    Once more, thank you for your help
  • Re: ModalPopupExtender - can't change a control

    02-08-2009, 5:49 PM
    • Member
      353 point Member
    • ForceMagic
    • Member since 04-02-2008, 7:05 PM
    • MainFrame
    • Posts 93

    Hi again,

     I'm glad the first solution works great. Actually, I'm not sure about your Ok button. What it's doing ? is it binded to a javascript function on client side ? or do you have an OnClick event on it ?

    Give me more information about this button plz ! Smile

    ~ ForceMagic - Aleajecta Dev Team ~

    Please click “Mark as Answer” on the post that helps you, and click “Unmark as Answer” if a marked post does not actually answer your question.
  • Re: ModalPopupExtender - can't change a control

    02-09-2009, 10:37 AM
    • Member
      1 point Member
    • Dev_001
    • Member since 02-06-2009, 11:25 AM
    • Posts 4
    Hi,

    In fact, my button worked only with the following parameters :

    <cc1:ModalPopupExtender ID="mpe" runat="server" TargetControlID="btHIDE" PopupControlID="panel"
            OkControlID="btOK" BackgroundCssClass="modalBackground" DropShadow="true" />
     I thought ModalPopupExtender managed the closing ...

     

  • Re: ModalPopupExtender - can't change a control

    02-09-2009, 11:09 AM
    • Member
      353 point Member
    • ForceMagic
    • Member since 04-02-2008, 7:05 PM
    • MainFrame
    • Posts 93

    Yeah actually it's managed by the Modal Popup Extender when you bind your closing button to OkControlID or CancelControlID. Wink

    ~ ForceMagic - Aleajecta Dev Team ~

    Please click “Mark as Answer” on the post that helps you, and click “Unmark as Answer” if a marked post does not actually answer your question.
  • Re: ModalPopupExtender - can't change a control

    02-09-2009, 4:43 PM
    • Member
      1 point Member
    • Dev_001
    • Member since 02-06-2009, 11:25 AM
    • Posts 4

     In fact, I've just to add a method Onclick with : mpe.Hide(); and the UpdatePanel is closed Smile

     

    Thanks for all !

Page 1 of 1 (7 items)