[CLOSED] Load ASCX control from AjaxEvent

  1. #1

    [CLOSED] Load ASCX control from AjaxEvent

    Hi, How can I load ASCX usercontrol from AjaxEvent?
    I want to do this in the AjaxEvent :

    protected void Button1_Click(object sender, AjaxEventArgs e)
    {
        string currentUc = "~/WebUserControl1.ascx";
    
        var uc = Page.LoadControl(currentUc);
    
        Window1.BodyControls.Clear();
    
        Window1.BodyControls.Add(uc);
    
        Window1.Show();
    
    }


    The WebuserControl.aspx



    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WebUserControl1.ascx.cs"
    
    
    Inherits="WebApplication1.WebUserControl1" %>
    
    
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    
    
    <ext:Panel ID="Panel1" runat="server" Frame="true" Title="Label Style and Separator"
    
    
    Width="250">
    
    
    <Body>
    
    
    <ext:FormLayout ID="FormLayout1" runat="server" LabelSeparator="-" LabelStyle="color:red;"
    
    
    LabelWidth="55">
    
    
    <ext:Anchor Horizontal="95%">
    
    
    <ext:TextField ID="TextField1" runat="server" FieldLabel="Label">
    
    
    </ext:TextField>
    
    
    </ext:Anchor>
    
    
    <ext:Anchor Horizontal="95%">
    
    
    <ext:TextField ID="TextField2" runat="server" FieldLabel="Label" LabelStyle="color:blue;"
    
    
    LabelSeparator="+">
    
    
    </ext:TextField>
    
    
    </ext:Anchor>
    
    
    </ext:FormLayout>
    
    
    </Body>
    
    
    </ext:Panel>


    Default.aspx


    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>
    
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    
    <head runat="server">
    
    <title></title>
    
    </head>
    
    <body>
    
    <form id="form1" runat="server">
    
    <ext:ScriptManager ID="ScriptManager1" runat="server" />
    
    <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
    
    <ext:Button ID="Button1" runat="server" Text="Show">
    
    <ajaxevents>
    
    <Click OnEvent="Button1_Click">
    
    </Click>
    
    </ajaxevents>
    
    </ext:Button>
    
    <ext:Window ID="Window1" runat="server" Icon="Group" Title="Window1" Width="400"
    
    Height="400" AutoShow="false" Modal="true" Show&#111;nload="false">
    
    <body>
    
    </body>
    
    <buttons>
    
    <ext:Button ID="SaveButton" runat="server" Text="Save" Icon="Disk">
    
    
    </ext:Button>
    
    <ext:Button ID="CancelButton" runat="server" Text="Cancel" Icon="Cancel">
    
    <Listeners>
    
    <Click Handler="#{Window1}.hide()" />
    
    </Listeners>
    
    </ext:Button>
    
    </buttons>
    
    </ext:Window>
    
    </form>
    
    </body>
    
    </html>
  2. #2

    RE: [CLOSED] Load ASCX control from AjaxEvent

    Hi,

    It is impossible. During AjaxEvent you can change properties of Coolite controls or register JavaScript. Creating controls or changing none Coolite controls is impossible because during AjaxEvent a page must return javascript only


  3. #3

    RE: [CLOSED] Load ASCX control from AjaxEvent

    Just a quick note regarding this issue... currently this functionality does not work (ie. return html/control during AjaxEvent/AjaxMethod), but this is our #1 priority during the next build cycle. With some luck for the v0.9 release we will have this all working.

    Geoffrey McGill
    Founder
  4. #4

    RE: [CLOSED] Load ASCX control from AjaxEvent



    That sound really cool!

    /Mikael
  5. #5

    RE: [CLOSED] Load ASCX control from AjaxEvent

    Bonjour Geoffrey
    Thanks for the note. Can I have information about v0.9 release date?
    Minimon

Similar Threads

  1. Replies: 2
    Last Post: Nov 15, 2012, 12:52 AM
  2. [CLOSED] How to make web user control (ascx) appear as an ext control
    By jmcantrell in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 11, 2010, 9:23 AM
  3. ascx control
    By maxdiable in forum 1.x Help
    Replies: 0
    Last Post: Jul 07, 2009, 5:42 AM
  4. [CLOSED] PanelBase.Load hides Control.Load Event
    By randy85253 in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Apr 22, 2009, 12:36 AM
  5. Click AjaxEvent and dynamic load ascx
    By songjuju in forum 1.x Help
    Replies: 0
    Last Post: Oct 25, 2008, 12:51 AM

Posting Permissions