Mar 02, 2011, 11:19 AM
How to hide the window containing the UserControl and call the method on the page that contains UserControl?
Hi!
It's my first UserControl:
How to return value?
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?