Click here to Skip to main content
15,889,876 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi

I am using Modal Popup Extender with Asp.net c#. My popup include a button and a textbox. I join a string in my textbox then click the button and save to my database. But i have a problem.

When i click the button, textbox value must transfer to another textbox that is in aspx file. But it doesn't work. Here is my code:

aspx.cs file:

C#
protected void BtnAddProject_Click(object sender, EventArgs e)
        {
            TxtProject.Text = TxtNewProject.Text; // txtproject in aspx file, txtnewproject in modal popup
            InsertUpdateDelete add = new InsertUpdateDelete();
            add.InsertProject(TxtNewProject.Text);
        }


aspx file:

XML
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:Button ID="BtnShowProject" runat="server" Text="Show" OnClick="BtnShowProject_Click" Style="display: none;" />
                <asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="BtnShowProject" PopupControlID="PnlCustomerInsert">
                </asp:ModalPopupExtender>
                <asp:Panel ID="PnlCustomerInsert" runat="server" BackColor="Silver" Width="300px" Height="300px" Style="display: none;">
                    <asp:UpdatePanel ID="UpdatePanel2" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional">
                        <ContentTemplate>
                            <asp:Button ID="BtnHideProject" runat="server" Text="Kapat" OnClick="BtnHideProject_Click" Style="text-align: right" />
                            <asp:Label ID="Label14" runat="server" Text="Kurum Adı:"></asp:Label>
                            <asp:TextBox ID="TxtNewProject" runat="server" ></asp:TextBox>
                            <asp:Button ID="BtnAddProject" runat="server" Text="Ekle" OnClick="BtnAddProject_Click" />
                        </ContentTemplate>
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="BtnHideProject" EventName="Click" />
                            <asp:AsyncPostBackTrigger ControlID="TxtProject" />
                        </Triggers>
                    </asp:UpdatePanel>
                </asp:Panel>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="BtnShowProject" EventName="Click" />
            </Triggers>
        </asp:UpdatePanel>
Posted
Updated 6-Apr-14 22:16pm
v2

Problem solved. I forget update panel :)
 
Share this answer
 
Thanks,

Even i forgot Update Panel :)
 
Share this answer
 
Comments
Richard Deeming 2-Nov-15 10:17am    
DO NOT post comments as new solutions. Use the "Have a Question or Comment?" button under the answer you are replying to.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900