How to show window in UserControl on client side?

  1. #1

    How to show window in UserControl on client side?

    I have the following UserControl:

    <%@ Control Language="VB" AutoEventWireup="false" CodeFile="AgencyView.ascx.vb" Inherits="AgencyView" %>
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    <%@ Register Src="~/AgencyPanel.ascx" TagName="AgencyPanel" TagPrefix="uc" %>
    
    <ext:Window ID="Window1" runat="server" Collapsible="false" Title="Agency" Show&#111;nload="false" Modal="true" BodyStyle="padding: 10px;" Resizable="false">
        <Body>
            <uc:AgencyPanel ID="AgencyPanel1" runat="server" />
        </Body>
        <Buttons>
            <ext:Button ID="btnOk" runat="server" Text="OK">
            </ext:Button>
            <ext:Button ID="Button1" runat="server" Text="Cancel">
            </ext:Button>
        </Buttons>  
    </ext:Window>
    I have this declared in Default.aspx as:

    <uc:AgencyView ID="AgencyView1" runat="server" />
    Currently, I have an AjaxMethod defined within the UserControl called Show. this then simply calls Window1.Show. however, this obviously requires a round trip to the server just to show the window. How would I show the window entirely from client side without calling an Ajaxmethod? I'm currently doing the following in Default.aspx:

    <ext:ToolbarButton ID="btnContactAdd" runat="server" Text="Add" Icon="VcardAdd">
    <Listeners>
    <Click Handler="Coolite.AjaxMethods.ShowAgency();" />
    </Listeners>
    </ext:ToolbarButton>
  2. #2

    RE: How to show window in UserControl on client side?

    <Click Handler="#{Window1}.show();" />

    Geoffrey McGill
    Founder
  3. #3

    RE: How to show window in UserControl on client side?

    The above code will not work. I thought the ToolbarButton was in the UserControl.

    I will revise the sample.

    Geoffrey McGill
    Founder
  4. #4

    RE: How to show window in UserControl on client side?

    But I don't know what the window name will actually be since it is contained within the UserControl. Perhaps I didn't make it clear with my example, but I don't want the consumer of the UserControl to actually know there is a Window inside the UserControl that must be opened.

    In other words, I want to call a method in UserControl which in turn takes care of showing the window within the UserControl. But, I want this to happen entirely on the client side. So something like:

    UserControl1.ShowAgent();

    But, I don't know if this is possible without making a round trip to the server. Please let me know.


Similar Threads

  1. [CLOSED] window autoload client side
    By Marcelo in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 17, 2012, 1:28 PM
  2. Replies: 1
    Last Post: Jan 27, 2012, 11:32 AM
  3. Replies: 0
    Last Post: Jun 13, 2011, 6:29 AM
  4. Close window - client and server side
    By Hanza in forum 1.x Help
    Replies: 1
    Last Post: Aug 23, 2010, 2:00 PM
  5. Replies: 4
    Last Post: Mar 19, 2010, 11:35 AM

Posting Permissions