May 20, 2009, 6:58 PM
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" 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:<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>