How to hide the window containing the UserControl and call the method on the page that contains UserControl?

  1. #1

    How to hide the window containing the UserControl and call the method on the page that contains UserControl?

    Hi!
    It's my first UserControl:
    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="Panel.ascx.cs" Inherits="UserControls_AccountPanel" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script type="text/javascript">
        win = <%= ModalWindow.ClientID %>;
    </script>
    <ext:Panel runat="server" BaseCls="x-plain" Cls="btn-panel">
      <Items>
        <ext:TableLayout runat="server" Columns="3">
          <Cells>
            <ext:Cell>
              <ext:Button ID="LoginButton" runat="server" Text="<%$ Resources:Authentication, LoginButton %>" Icon="UserKey" Scale="Medium">
                <DirectEvents>
                  <Click OnEvent="OpenLoginWindow">
                    <EventMask ShowMask="true" MinDelay="250"/>
                  </Click>
                </DirectEvents>
              </ext:Button>
            </ext:Cell>
           ?
          </Cells>
        </ext:TableLayout>
      </Items>
    </ext:Panel>
    
    <ext:Window ID="ModalWindow" runat="server" Modal="true" Hidden="true">
      <Content>
        <asp:PlaceHolder ID="WindowPlaceHolder" runat="server"/>
      </Content>
      <DirectEvents>
        <Hide OnEvent="" />
      </DirectEvents>
    </ext:Window>
    It's codebehind:
    ?
        protected void OpenLoginWindow(object sender, DirectEventArgs e)
        {
            ChangeUserControl("Login.ascx");
        }
    
        private void ChangeUserControl(string ucPath)
        {
            var ucLogin = LoadControl(ucPath);
            WindowPlaceHolder.Controls.Clear();
            WindowPlaceHolder.Controls.Add(ucLogin);
            ModalWindow.UpdateContent();
            ModalWindow.Show();
        }
    ?
    Login.ascx
    <%@ Control Language="C#" ClassName="Login" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <ext:Button runat="server" Text="dddd">
      <Listeners>
        <Click Handler="win.hide(null); return false;"/>
      </Listeners>
    </ext:Button>
    I assign in the parent UserControl JS-variable, but I can not call in Login.ascx. How to realize such a trick?
    How to return value?
  2. #2
    Did you figure this out? I am having the same question.

    Miguel.

Similar Threads

  1. Replies: 8
    Last Post: Feb 15, 2012, 9:04 AM
  2. Replies: 0
    Last Post: Mar 29, 2011, 3:59 PM
  3. Replies: 1
    Last Post: Mar 11, 2011, 2:54 PM
  4. [CLOSED] [1.0] DirectMethod - Page . UserControl . UserControl
    By Patrick in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Feb 25, 2010, 9:33 AM
  5. Can't call AjaxMethod in UserControl
    By dbassett74 in forum 1.x Help
    Replies: 2
    Last Post: May 20, 2009, 6:11 PM

Tags for this Thread

Posting Permissions