UpdatePanel Nested in a ModalPopUp

Last post 01-31-2007 11:05 AM by Zonkd. 3 replies.

Sort Posts:

  • UpdatePanel Nested in a ModalPopUp

    01-29-2007, 5:36 PM
    • Loading...
    • Zonkd
    • Joined on 01-29-2007, 5:31 PM
    • Posts 7

    I am having some problems getting the following code to work. May not be possible, but any suggestions would help. This is obviously a slimmed down version of what I am attempting to do but you get the point.

     

    <%@ Page Language="C#" AutoEventWireup="true" %>
    <%
    @ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <
    html xmlns="http://www.w3.org/1999/xhtml" >
    <
    head runat="server">
    <title>Untitled Page</title>
    <script language="CS" runat="server">

    protected void Page_Load(object sender, EventArgs e)
    {
    }

    protected void btnShow_Click(object sender, EventArgs e)
    {

    ModalPopupExtender1.Show();
    txtTest.Text = "Test";

    }

    protected void btnOK_Click(object sender, EventArgs e)
    {

    txtTest.Text = "GO!!!";
    ModalPopupExtender1.Hide();

    }

    </script>
    </
    head>

    <

    body>
    <form id="form1" runat="server">

    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="True" />
    <asp:Button runat="server" ID="btnShow" Text="Show" OnClick="btnShow_Click" />

    <asp:Panel runat="Server" ID="pnlModal" style="border: solid 1px black; background-color: Gray;">

    <asp:UpdatePanel runat="server" ID="upnlModal" UpdateMode="Conditional" ChildrenAsTriggers="True">

    <ContentTemplate>

    <asp:TextBox runat="Server" ID="txtTest" />

    <asp:Button runat="server" ID="btnOK" Text="OK" OnClick="btnOK_Click" />

    </ContentTemplate>

    <Triggers>

    <asp:AsyncPostBackTrigger ControlID="btnShow" />

    </Triggers>

    </asp:UpdatePanel>

    </asp:Panel>

    <asp:Button runat="server" ID="btnHidden" style="display: none;" />

    <cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="btnHidden" PopupControlID="pnlModal"></cc1:ModalPopupExtender>

    </form>

    </

    body>

    </

    html>
  • Re: UpdatePanel Nested in a ModalPopUp

    01-30-2007, 9:36 AM
    • Loading...
    • Zonkd
    • Joined on 01-29-2007, 5:31 PM
    • Posts 7
    Any ideas?
  • Re: UpdatePanel Nested in a ModalPopUp

    01-30-2007, 5:45 PM
    I'm not sure you said what the problem is, but taking btnOK out of the UpdatePanel would probably help.
    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: UpdatePanel Nested in a ModalPopUp

    01-31-2007, 11:05 AM
    Answer
    • Loading...
    • Zonkd
    • Joined on 01-29-2007, 5:31 PM
    • Posts 7

    The problem was that I was not getting the form elements in my post back. When I examined Request.Form it did not contain any of the controls in the modal window on postback. I found out that this was related to another problem I had and when I made the correct changes, this problem went away.

     http://forums.asp.net/1557527/ShowThread.aspx#1557527 (related problem)

Page 1 of 1 (4 items)
Microsoft Communities
Page view counter