How do I get a value from an asp:textbox into an asp:textbox in a modal window.


Active member
Jan 21, 2012
Programming Experience
I have a mail subscription script, and its working, like this.
<div class="block-content"> 
        <div class="form-subscribe-header">Sign up for our newsletter</div> 
            <label for="newsletter">Sign Up for Our Newsletter:</label> 
            <div class="input-box"> 
                <asp:TextBox ID="newsletter" runat="server" CssClass="input-text required-entry validate-email" Text="Tilmeld dig til vores Nyhedsbrev"></asp:TextBox> 
            <div class="actions"> 
                <asp:ImageButton runat="server" ID="btnSubscribe" ImageUrl="~/add/image/btntilmeld.png"></asp:ImageButton> 

Now I want to take the value fron the asp:textbox to a asp:textbox inside a modal popup.
I have the code for the popup and its working.
<form id="form1" runat="server"> 
    <asp:ToolkitScriptManager ID="ScriptManager1" runat="server"> 
    <asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="lnkPopup" PopupControlID="panEdit" BackgroundCssClass="modalBackground" CancelControlID="btnCancel" PopupDragHandleControlID="panEdit"> 
<asp:Panel ID="panEdit" runat="server" Height="180px" Width="400px" CssClass="ModalWindow"> 
        <table width="100%"> 
                <td class="formtext" style="height: 23px; width: 150px;" align="left"> 
                    <asp:TextBox ID="txtFields1" runat="server"></asp:TextBox> 
       <br /> 
<!-- <a id="lnkPopup" runat="server">Show Popup</a> --> 
<input type="button" id="lnkPopup" title="Button" /> 

but i can only get the popup to work with a input type button or an a link.
If i changes the asp:button or asp:imagebutton ID, from the mailscript to lnkPopup, it will note open the popup.

so i hope someone can help me.
How do i put the 2 script together so i can:
- use the asp:textbox as now with asp:RegularExpressionValidator, and if this is OK
- then when hit submit the mail will be send to the modal popup to the asp:textbox inside that and the popup will ofc. be showed
- when hitting the asp:imagebutton if its possible to use this to activate the modal popup.Hope someone can help me.
Top Bottom