How to show window in UserControl on client side?
I have the following UserControl:
Code:
<%@ 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" Showonload="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:
Code:
<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:
Code:
<ext:ToolbarButton ID="btnContactAdd" runat="server" Text="Add" Icon="VcardAdd">
<Listeners>
<Click Handler="Coolite.AjaxMethods.ShowAgency();" />
</Listeners>
</ext:ToolbarButton>
RE: How to show window in UserControl on client side?
Code:
<Click Handler="#{Window1}.show();" />
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.
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.