Dynamic User controls with window controls is not working

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Dynamic User controls with window controls is not working

    Hi

    In my page i am calling one user control with in ext.window control. But it is not working.
    First of all window is not opening also it shows javascript error like
    'Inv_dsMastercolumns is undefined'
    protected void Button2_Click(object sender, DirectEventArgs e)
            {
                Window win1212 = new Window
                {
                    ID = "windowUserControl",
                    Title = "User Information",
                    Height = 400,
                    Width = 400,
                    Padding = 5,
                    Resizable = false,
                    Modal = true
                };
                var invoice = LoadControl("~/Views/Shared/UserControls/HideShow.ascx");
                invoice.ID = "Inv";
                win1212.ContentContainer.Controls.Add(invoice);
                this.Controls.Add(win1212);
                win1212.Render();           
            }
    <ext:Button ID="btnHideshowcolumns" runat="server" Text="Hide/Show">
                                            <DirectEvents>
                                                <Click OnEvent="Button2_Click">
                                                </Click>
                                            </DirectEvents>
                                        </ext:Button>
    Due to page size i am unable share my page here.
    For detailed information i added my .aspx page and .ascx page.
    for reproducing above mentioned error you can download my sample project here

    Thanks in advance
    Attached Thumbnails Click image for larger version. 

Name:	jaucerror.JPG 
Views:	199 
Size:	81.2 KB 
ID:	2508  
    Last edited by vs.mukesh; Mar 29, 2011 at 1:10 PM.
  2. #2
    Quote Originally Posted by vs.mukesh View Post
    Hi

    In my page i am calling one user control with in ext.window control. But it is not working.
    First of all window is not opening also it shows javascript error like

    protected void Button2_Click(object sender, DirectEventArgs e)
            {
                Window win1212 = new Window
                {
                    ID = "windowUserControl",
                    Title = "User Information",
                    Height = 400,
                    Width = 400,
                    Padding = 5,
                    Resizable = false,
                    Modal = true
                };
                var invoice = LoadControl("~/Views/Shared/UserControls/HideShow.ascx");
                invoice.ID = "Inv";
                win1212.ContentContainer.Controls.Add(invoice);
                this.Controls.Add(win1212);
                win1212.Render();           
            }
    <ext:Button ID="btnHideshowcolumns" runat="server" Text="Hide/Show">
                                            <DirectEvents>
                                                <Click OnEvent="Button2_Click">
                                                </Click>
                                            </DirectEvents>
                                        </ext:Button>
    Due to page size i am unable share my page here.
    For detailed information i added my .aspx page and .ascx page.
    for reproducing above mentioned error you can download my sample project here

    Thanks in advance
    Try like that:
    
    protected void Button2_Click(object sender, DirectEventArgs e)
            {
                Window win1212 = new Window
                {
                    ID = "windowUserControl",
                    Title = "User Information",
                    Height = 400,
                    Width = 400,
                    Padding = 5,
                    Resizable = false,
                    Modal = true
                };
                var invoice = LoadControl("~/Views/Shared/UserControls/HideShow.ascx");
                invoice.ID = "Inv";
                win1212.ContentContainer.Controls.Add(invoice);
                this.Controls.Add(win1212);
                win1212.Render(this.Page);
                win1212.Show();           
            }

Similar Threads

  1. How to load dynamic user controls on desktop shortcut?
    By laphuynhkien in forum 2.x Help
    Replies: 4
    Last Post: Aug 23, 2012, 5:58 PM
  2. [CLOSED] field value empty in dynamic user controls...
    By Vladimir in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Dec 28, 2010, 8:17 AM
  3. [CLOSED] Dynamic load user controls in Opera
    By Timur.Akhmerov in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: May 06, 2010, 2:49 AM
  4. [CLOSED] Dynamic loading of user controls [1.0]
    By SFritsche in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Feb 11, 2010, 6:08 AM
  5. Replies: 2
    Last Post: Aug 01, 2009, 9:07 AM

Posting Permissions