problem in DirectEvent of button for Run time loaded User Control.

Page 1 of 4 123 ... LastLast
  1. #1

    problem in DirectEvent of button for Run time loaded User Control.

    Hi To All

    https://examples1.ext.net/#/XRender/...UpdateContent/
    With the help of above example I suceeded to load user control in run time.
    I have one Ext:button control with directevent in User control.
    After loading when I click on button it gives error as

    "The control with ID 'ButtonId' not found"

    https://examples1.ext.net/#/XRender/...UpdateContent/
    In above example can u add Directevent in Ext:Button of Any User Control.

    Thanks In Advance

    Rupesh
  2. #2
    Hi To All

    Any Updates??????????????

    Rupesh
  3. #3
    Hi,

    It needs to recreate a control during each request (in your case this is DirectEvent) if you need to use DirectEvent for this control.

    Please use DirectMethod instead of DirectEvent, see
    https://examples1.ext.net/#/Events/D.../UserControls/
  4. #4
    Hi

    I used DirectMethod instead of DirectEvent, But After click on button it gives an error that
    Ext.net.DirectMethods.UC3.JawClickSave is not a function

    coding in usercontrol.ascx file

    <ext:Button ID="btnsave" runat="server" Text="Save">
                <Listeners>
                    <Click Handler="#{DirectMethods}.JawClickSave();" />
                </Listeners>
            </ext:Button>
    coding in usercontrol.ascx.cs file

    [DirectMethod]
        public void jawClickSave()
        {
            X.Msg.Alert("Message", "Hi").Show();
        }
    Rupesh
    Last edited by geoffrey.mcgill; Dec 30, 2010 at 5:17 AM.
  5. #5
    Hi,

    In future forum posts, please wrap code samples in [CODE] tags.
    Geoffrey McGill
    Founder
  6. #6
    Hi,

    Your code sample looks correct.

    Unfortunately, the code you provided is not enough information for us to diagnose the problem.
    Geoffrey McGill
    Founder
  7. #7
    Hi

    Code in JawClicking.ascx
    *********************************
    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="JawClicking.ascx.cs" Inherits="UserControl_JawClicking" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <ext:Panel ID="jawclickPanel1" runat="server" Title="Jaw Clicking" Padding="5" BodyBorder="true"
        Width="1040" Height="470" ButtonAlign="Center">
        <Items>
            <ext:Panel ID="jawclickPanel7" runat="server" Frame="true" Width="1000" BodyStyle="background-color:transparent;"
                ButtonAlign="Center">
                <Items>
                    <ext:Container ID="jawclickContainer1" runat="server" Layout="Column" Height="40"
                        BodyStyle="background-color:#fff;">
                        <Items>
                            <ext:Container ID="jawclickContainer2" runat="server" LabelAlign="Top" Layout="Form"
                                ColumnWidth=".33">
                                <Items>
                                    <ext:ComboBox ID="jawclickcboReason" ForceSelection="false" runat="server" FieldLabel="Reason of Visit"
                                        LabelStyle="color:#284382;font-weight:bold;" AnchorHorizontal="98%" AllowBlank="false">
                                        <Items>
                                            <ext:ListItem Text="New Symptoms" Value="New Symptons" />
                                            <ext:ListItem Text="Exacerbation" Value="Exacerbation" />
                                            <ext:ListItem Text="Recurrence" Value="Recurrence" />
                                        </Items>
                                    </ext:ComboBox>
                                </Items>
                            </ext:Container>
                            <ext:Container ID="jawclickContainer3" runat="server" LabelAlign="Top" Layout="Form"
                                ColumnWidth=".33">
                                <Items>
                                    <ext:ComboBox ID="jawclickcboClicking" ForceSelection="false" runat="server" FieldLabel="Reason of clicking"
                                        LabelStyle="color:#284382;font-weight:bold;" AnchorHorizontal="98%">
                                        <Items>
                                            <ext:ListItem Text="Accident" Value="Accident" />
                                            <ext:ListItem Text="Trauma" Value="Trauma" />
                                        </Items>
                                    </ext:ComboBox>
                                </Items>
                            </ext:Container>
                            <ext:Container ID="jawclickContainer4" runat="server" LabelAlign="Top" Layout="Form"
                                ColumnWidth=".33">
                                <Items>
                                    <ext:ComboBox ID="jawclickcboSymptoms" ForceSelection="false" runat="server" FieldLabel="When Symtomps Started?"
                                        LabelStyle="color:#284382;font-weight:bold;" AnchorHorizontal="95%">
                                        <Items>
                                            <ext:ListItem Text="1-2 Weeks" Value="1-2 Weeks" />
                                            <ext:ListItem Text="2-4 Weeks" Value="2-4 Weeks" />
                                            <ext:ListItem Text="4-8 Weeks" Value="4-8 Weeks" />
                                        </Items>
                                    </ext:ComboBox>
                                </Items>
                            </ext:Container>
                        </Items>
                    </ext:Container>
                </Items>
            </ext:Panel>
            
        </Items>
    </ext:Panel>
    <ext:Panel ID="pnlJawClickButton" runat="server" BodyBorder="false" Height="30" Width="1020"
        ButtonAlign="Center">
        <Buttons>
            
            <ext:Button ID="btnsave" runat="server" Text="Save">
                <Listeners>
                    <Click Handler="#{DirectMethods}.JawClickSave();" />
                </Listeners>
            </ext:Button>
        </Buttons>
        
    </ext:Panel>
    *******************************

    code in JawClicking.ascx.cs file
    ********************************
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using Ext.Net;
    using Ext.UC;
    using System.Data;
    
    public partial class UserControl_JawClicking : BaseUserControl
    {
       
        protected void Page_Load(object sender, EventArgs e)
        {
            
           
        }
    
        public override List<string> ControlsToDestroy
        {
            get
            {
                // we should return none lazy controls only because lazy controls will be autodestroyed by parent container
                return new List<string>
                           {
                               
                           };
            }
        }
    
        [DirectMethod]
        public void DirectMethod()
        {
    
        }
    
        [DirectMethod]
        public void jawClickSave() 
        { 
            X.Msg.Alert("Message", "Hi").Show(); 
        }
    
       
    }
    *************************************

    code in BaseUserControl.cs file
    *******************************
    using System.Collections.Generic;
    using System.Web.UI;
    
    namespace Ext.UC
    {
        /// <summary>
        /// Summary description for BaseUserControl
        /// </summary>
        public class BaseUserControl : UserControl
        {
    
            public virtual List<string> ControlsToDestroy
            {
                get
                {
                    // we should return none lazy controls only because lazy controls will be autodestroyed by parent container
                    return new List<string>();
                }
            }
    
    
        }
    }
    **********************************

    code in aspx page
    ************************************
    <%@ Page Title="" Language="C#"  AutoEventWireup="true" CodeFile="NewComplaints.aspx.cs" Inherits="Demo" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title>Deluxe Portal in TabPanel - Ext.NET Examples</title> 
        
    <script type="text/javascript">
            var destroyFromCache = function(container) {
                container.controlsCache = container.controlsCache || [];
                Ext.each(container.controlsCache, function(controlId) {
                    var control = Ext.getCmp(controlId);
                    if (control && control.destroy) {
                        control.destroy();
                    }
                });
            };
            
            var putToCache = function(container, controls) {
                container.controlsCache = controls;
            };
        </script>
    
    </head> 
    <body> 
    <form id="Form1" runat="server">    
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
        <ext:Viewport ID="Viewport1" runat="server" StyleSpec="background-color: transparent;">
            <Items>
                <ext:BorderLayout ID="BorderLayout1" runat="server">  
                    <Center MarginsSummary="5 7 5 5">
                        <ext:TabPanel 
                            ID="TabPanel1" 
                            runat="server" 
                            Title="TabPanel" 
                            ActiveTabIndex="0" 
                            TabAlign="Left"                                                 
                            TabPosition="Top"
                            Border="false"                         
                            BodyStyle="border:1px solid #AABBCC; border-top: none;">
                            <Items>
                                <ext:Panel 
                                    ID="TabComplaints" 
                                    runat="server" 
                                    Title="Complaints" 
                                    Icon="GroupError"                                                                         
                                    BodyStyle="background-color:#DDEEFF;"
                                    Layout="Fit"
                                    ButtonAlign="Center"
                                    >                                
                                    <Items>                                
                                      <ext:GroupTabPanel ID="GroupTabPanel1" runat="server" TabWidth="180" Cls="vertical-tabs"   BodyStyle="border:1px solid #82ACCE;" >
                                          <Groups>  
                                             <ext:GroupTab ID="grpJawClicking" runat="server" Cls="topbottompadding">
                                                <Items>
                                                    <ext:Panel ID="Panel5" 
                                                        runat="server" 
                                                        Title="JAW CLICKING" 
                                                        TabTip="JAW CLICKING" 
                                                        StyleSpec="padding:5px;" > 
                                                        
                                                          
                                                        </ext:Panel>
                                                </Items>
                                                <DirectEvents>
                                                    <Show OnEvent="DisplayJawClicking"></Show>
                                                </DirectEvents>
                                            </ext:GroupTab>                                                                       
                                             
                                             
                                           
                                         </Groups>
                                      </ext:GroupTabPanel>                                                              
                                    </Items>
                                    
                                </ext:Panel>
                                                             
                            </Items>
                        </ext:TabPanel> 
                    </Center>
                </ext:BorderLayout>
            </Items>
        </ext:Viewport>
    </form>
    </body>
    </html>
    ************************************

    code in aspx.cs file
    ***********************************
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using Ext.Net;
    using Ext.UC;
    
    namespace AdsLogyTesting
    {
        public partial class forumpage : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
    
            }
    
            protected void DisplayJawClicking(object sender, EventArgs e)
            {
                X.Js.Call("destroyFromCache", new JRawValue(Panel5.ClientID));
                BaseUserControl uc3 = (BaseUserControl)this.LoadControl("UserControl/JawClicking.ascx");
                uc3.ID = "UC3";
                this.Panel5.ContentControls.Add(uc3);
    
                X.Js.Call("putToCache", new JRawValue(Panel5.ClientID), uc3.ControlsToDestroy);
                this.Panel5.UpdateContent();
            }
        }
    }
    ************************************


    Hoping for best.
    Thanks.
    Rupesh
    Last edited by Rupesh; Dec 30, 2010 at 7:01 AM.
  8. #8
    Hi Guys,

    Any updates???????
    Its urgent.
    Pls give solution, if any.

    Thanks
    Rupesh
  9. #9
    Hi,

    There are two problems.

    1. Wrong case
    [DirectMethod]
    public void JawClickSave()
    {
        X.Msg.Alert("Message", "Hi").Show();
    }
    but

    <Click Handler="#{DirectMethods}.JawClickSave();" />
    There must be identical case like
    public void JawClickSave()
    and
    #{DirectMethods}.JawClickSave();
    2. UserControl must be recreated (in Page_Load or Page_Init, for example). In a different way ResourceManager won't find DirectMethod.

    So, please use (for example)
    protected void Page_Load(object sender, EventArgs e)
    {
        X.Js.Call("destroyFromCache", new JRawValue(Panel5.ClientID));
        BaseUserControl uc3 = (BaseUserControl)this.LoadControl("JawClicking.ascx");
        uc3.ID = "UC3";
        this.Panel5.ContentControls.Add(uc3);
    
        X.Js.Call("putToCache", new JRawValue(Panel5.ClientID), uc3.ControlsToDestroy);
        this.Panel5.UpdateContent();
    }
    instead of
    protected void DisplayJawClicking(object sender, EventArgs e) { ... }
  10. #10
    Hi Guys

    I got the selected values of reason of visit combobox (jawclickcboReason), when I click on save button of first user control.
    After saving, second user control is loaded runtime.
    In this control when I click on save button, I am not getting selected value of reason of visit (CboJawLockingcboReason).
    Code is as below.

    BaseUserControl.cs file code
    **************************
    using System.Collections.Generic;
    using System.Web.UI;
    
    namespace Ext.UC
    {
        /// <summary>
        /// Summary description for BaseUserControl
        /// </summary>
        public class BaseUserControl : UserControl
        {
    
            public virtual List<string> ControlsToDestroy
            {
                get
                {
                    // we should return none lazy controls only because lazy controls will be autodestroyed by parent container
                    return new List<string>();
                }
            }
    
    
        }
    }
    ********************************

    Code in main aspx file
    *********************************
    <%@ Page Title="" Language="C#"  AutoEventWireup="true" CodeFile="forumpage.aspx.cs" Inherits="Demo" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
       
    <script type="text/javascript">
            var destroyFromCache = function(container) {
                container.controlsCache = container.controlsCache || [];
                Ext.each(container.controlsCache, function(controlId) {
                    var control = Ext.getCmp(controlId);
                    if (control && control.destroy) {
                        control.destroy();
                    }
                });
            };
            
            var putToCache = function(container, controls) {
                container.controlsCache = controls;
            };
        </script>
    
    </head> 
    <body> 
    <form id="Form1" runat="server">    
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
        <ext:Viewport ID="Viewport1" runat="server" StyleSpec="background-color: transparent;">
            <Items>
                <ext:BorderLayout ID="BorderLayout1" runat="server">  
                    <Center MarginsSummary="5 7 5 5">
                        <ext:TabPanel 
                            ID="TabPanel1" 
                            runat="server" 
                            Title="TabPanel" 
                            ActiveTabIndex="0" 
                            TabAlign="Left"                                                 
                            TabPosition="Top"
                            Border="false"                         
                            BodyStyle="border:1px solid #AABBCC; border-top: none;">
                            <Items>
                                <ext:Panel 
                                    ID="TabComplaints" 
                                    runat="server" 
                                    Title="Complaints" 
                                    Icon="GroupError"                                                                         
                                    BodyStyle="background-color:#DDEEFF;"
                                    Layout="Fit"
                                    ButtonAlign="Center"
                                    >                                
                                    <Items>                                
                                      <ext:GroupTabPanel ID="GroupTabPanel1" runat="server" TabWidth="180" Cls="vertical-tabs"   BodyStyle="border:1px solid #82ACCE;" >
                                          <Groups>  
                                             <ext:GroupTab ID="grpJawClicking" runat="server" Cls="topbottompadding">
                                                <Items>
                                                    <ext:Panel ID="Panel5" 
                                                        runat="server" 
                                                        Title="JAW CLICKING" 
                                                        TabTip="JAW CLICKING" 
                                                        StyleSpec="padding:5px;" > 
                                                        
                                                          
                                                        </ext:Panel>
                                                </Items>
                                                <DirectEvents>
                                                    <Show OnEvent="TempFunction"></Show>
                                                </DirectEvents>
                                            </ext:GroupTab>                                                                       
                                             
                                             
                                           
                                         </Groups>
                                      </ext:GroupTabPanel>    
                                      <ext:GroupTab ID="grpJawLocking" runat="server" Cls="topbottompadding">
                                                <Items>
                                                    <ext:Panel ID="Panel8" 
                                                        runat="server" 
                                                        Title="JAW LOCKING" 
                                                        TabTip="JAW LOCKING" 
                                                        StyleSpec="padding:5px;">
                                                        
                                                        </ext:Panel>    
                                                </Items>
                                                
                                                <DirectEvents>
                                                    <Show OnEvent="TempFunction"></Show>
                                                </DirectEvents>
                                            </ext:GroupTab>                                                          
                                    </Items>
                                    
                                </ext:Panel>
                                                             
                            </Items>
                        </ext:TabPanel> 
                    </Center>
                </ext:BorderLayout>
            </Items>
        </ext:Viewport>
    </form>
    </body>
    </html>
    **************************************

    code in main aspx.cs file
    ******************************************
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using Ext.Net;
    using Ext.UC;
    
    namespace AdsLogyTesting
    {
        public partial class forumpage : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                if (GroupTabPanel1.ActiveGroupIndex == 0)
                {
                    DisplayJawClicking();
                }
                else
                {
                    DisplayJawLocking();
                }
            }
    
            protected void DisplayJawLocking()
            {
                X.Js.Call("destroyFromCache", new JRawValue(Panel8.ClientID));
                BaseUserControl uc2 = (BaseUserControl)this.LoadControl("UserControl/JawLockingControl.ascx");
                uc2.ID = "UC3";
                this.Panel8.ContentControls.Add(uc2);
    
                X.Js.Call("putToCache", new JRawValue(Panel8.ClientID), uc2.ControlsToDestroy);
                this.Panel8.UpdateContent();
    
                //this.Button1.Disabled = false;
                //this.Button2.Disabled = true;
    
            }
            protected void DisplayJawClicking()
            {
                X.Js.Call("destroyFromCache", new JRawValue(Panel5.ClientID));
                BaseUserControl uc2 = (BaseUserControl)this.LoadControl("UserControl/JawClicking.ascx");
                uc2.ID = "UC2";
                this.Panel5.ContentControls.Add(uc2);
    
                X.Js.Call("putToCache", new JRawValue(Panel5.ClientID), uc2.ControlsToDestroy);
                this.Panel5.UpdateContent();
            }
            protected void TempFunction(object sender, EventArgs e)
            {
    
            }
        }
    }
    ************************************

    COde in first user control ascx file
    **********************************
    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="JawClicking.ascx.cs" Inherits="UserControl_JawClicking" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <ext:Panel ID="jawclickPanel1" runat="server" Title="Jaw Clicking" Padding="5" BodyBorder="true"
        Width="1040" Height="470" ButtonAlign="Center">
        <Items>
            <ext:Panel ID="jawclickPanel7" runat="server" Frame="true" Width="1000" BodyStyle="background-color:transparent;"
                ButtonAlign="Center">
                <Items>
                    <ext:Container ID="jawclickContainer1" runat="server" Layout="Column" Height="40"
                        BodyStyle="background-color:#fff;">
                        <Items>
                            <ext:Container ID="jawclickContainer2" runat="server" LabelAlign="Top" Layout="Form"
                                ColumnWidth=".33">
                                <Items>
                                    <ext:ComboBox ID="jawclickcboReason" ForceSelection="false" runat="server" FieldLabel="Reason of Visit"
                                        LabelStyle="color:#284382;font-weight:bold;" AnchorHorizontal="98%" AllowBlank="false">
                                        <Items>
                                            <ext:ListItem Text="New Symptoms" Value="New Symptons" />
                                            <ext:ListItem Text="Exacerbation" Value="Exacerbation" />
                                            <ext:ListItem Text="Recurrence" Value="Recurrence" />
                                        </Items>
                                    </ext:ComboBox>
                                </Items>
                            </ext:Container>
                            <ext:Container ID="jawclickContainer3" runat="server" LabelAlign="Top" Layout="Form"
                                ColumnWidth=".33">
                                <Items>
                                    <ext:ComboBox ID="jawclickcboClicking" ForceSelection="false" runat="server" FieldLabel="Reason of clicking"
                                        LabelStyle="color:#284382;font-weight:bold;" AnchorHorizontal="98%">
                                        <Items>
                                            <ext:ListItem Text="Accident" Value="Accident" />
                                            <ext:ListItem Text="Trauma" Value="Trauma" />
                                        </Items>
                                    </ext:ComboBox>
                                </Items>
                            </ext:Container>
                            <ext:Container ID="jawclickContainer4" runat="server" LabelAlign="Top" Layout="Form"
                                ColumnWidth=".33">
                                <Items>
                                    <ext:ComboBox ID="jawclickcboSymptoms" ForceSelection="false" runat="server" FieldLabel="When Symtomps Started?"
                                        LabelStyle="color:#284382;font-weight:bold;" AnchorHorizontal="95%">
                                        <Items>
                                            <ext:ListItem Text="1-2 Weeks" Value="1-2 Weeks" />
                                            <ext:ListItem Text="2-4 Weeks" Value="2-4 Weeks" />
                                            <ext:ListItem Text="4-8 Weeks" Value="4-8 Weeks" />
                                        </Items>
                                    </ext:ComboBox>
                                </Items>
                            </ext:Container>
                        </Items>
                    </ext:Container>
                </Items>
            </ext:Panel>
            
        </Items>
    </ext:Panel>
    <ext:Panel ID="pnlJawClickButton" runat="server" BodyBorder="false" Height="30" Width="1020"
        ButtonAlign="Center">
        <Buttons>
            
            <ext:Button ID="btnsave" runat="server" Text="Save">
                <Listeners>
                    <Click Handler="#{DirectMethods}.JawClickSave();" />
                </Listeners>
            </ext:Button>
        </Buttons>
        
    </ext:Panel>
    *************************************

    Code in First User control ascx.cs file
    ************************************
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using Ext.Net;
    using Ext.UC;
    using System.Data;
    
    public partial class UserControl_JawClicking : BaseUserControl
    {
       
        protected void Page_Load(object sender, EventArgs e)
        {
           
        }
    
        public override List<string> ControlsToDestroy
        {
            get
            {
                // we should return none lazy controls only because lazy controls will be autodestroyed by parent container
                return new List<string>
                           {
                               
                           };
            }
        }
    
        [DirectMethod]
        public void DirectMethod()
        {
    
        }
    
        [DirectMethod]
        public void jawClickSave()
        {
            X.Msg.Alert("Message", jawclickcboReason.SelectedItem.Text).Show();
    
            GroupTab gtp = new GroupTab();
            gtp = ((GroupTab)this.Parent.FindControl("GroupTabPanel1").FindControl("grpJawLocking"));
            gtp.SetActiveTab(0);
        }
    
       
    }
    ****************************************

    Code in second user cotrol ascx file
    ************************************
    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="JawLockingControl.ascx.cs"
        Inherits="UserControl_JawLockingControl" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <ext:Panel ID="PnlJawLockingOuter" runat="server" Title="Jaw Locking" ButtonAlign="Center"
        Padding="5" BodyStyle="background-color:transparent;" BodyBorder="true" Width="1040"
        Height="450">
        <Items>
            <ext:Panel ID="PnlJawLockingInner" runat="server" Frame="true" Width="1000" BodyStyle="background-color:transparent;"
                ButtonAlign="Center" >
                <Items>
                    <ext:Container ID="CntJawLockingVisitReasonMain" runat="server" Layout="Column" Height="40"
                        BodyStyle="background-color:#fff;" >
                        <Items>
                            <ext:Container ID="CntJawLockingVisitReasonSub" runat="server" LabelAlign="Top" Layout="Form"
                                ColumnWidth=".33">
                                <Items>
                                    <ext:ComboBox ID="CboJawLockingcboReason" runat="server" FieldLabel="Reason of Visit"
                                        LabelStyle="color:#284382;font-weight:bold;" AnchorHorizontal="98%" SelectedIndex="0"
                                        ForceSelection="false" Width="350">
                                        <Items>
                                            <ext:ListItem Text="Select" Value="Select" />
                                            <ext:ListItem Text="New Symptoms" Value="New Symptons" />
                                            <ext:ListItem Text="Exacerbation" Value="Exacerbation" />
                                            <ext:ListItem Text="Recurrence" Value="Recurrence" />
                                            <ext:ListItem Text="Other" Value="Other" />
                                        </Items>
                                    </ext:ComboBox>
                                </Items>
                            </ext:Container>
                            <ext:Container ID="CntJawLockingSymptoms" runat="server" LabelAlign="Top" Layout="Form"
                                ColumnWidth=".33">
                                <Items>
                                    <ext:ComboBox ID="cboJawLockingSymptoms" runat="server" FieldLabel="When Symtomps Started?"
                                        LabelStyle="color:#284382;font-weight:bold;" AnchorHorizontal="95%" SelectedIndex="0"
                                        Width="350">
                                        <Items>
                                            <ext:ListItem Text="Select" Value="Select" />
                                            <ext:ListItem Text="1-2 Weeks" Value="1-2 Weeks" />
                                            <ext:ListItem Text="2-4 Weeks" Value="2-4 Weeks" />
                                            <ext:ListItem Text="4-8 Weeks" Value="4-8 Weeks" />
                                            <ext:ListItem Text="Other" Value="Other" />
                                        </Items>
                                    </ext:ComboBox>
                                </Items>
                            </ext:Container>
                            <ext:Container ID="CntJawLockingBlank" runat="server" LabelAlign="Top" Layout="Form"
                                ColumnWidth=".33">
                                <Items>
                                </Items>
                            </ext:Container>
                        </Items>
                    </ext:Container>
                </Items>
            </ext:Panel>
            
        </Items>
    </ext:Panel>
    <ext:Panel ID="pnlJawLockingButton" ButtonAlign="Center" runat="server" BodyBorder="false" Height="30"
        Width="1020">
        <Buttons>
            <ext:ImageButton ID="JawLockingSave" ImageUrl="../images/save.png" runat="server">
                <Listeners>
                    <Click Handler="#{DirectMethods}.jawLockingSave();" />
                </Listeners>
                
            </ext:ImageButton>
        </Buttons>
        
    </ext:Panel>
    *******************************

    code in second user control ascx.cs file
    ********************************
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using Ext.Net;
    using Ext.UC;
    
    
    public partial class UserControl_JawLockingControl : BaseUserControl
    {
       protected void Page_Load(object sender, EventArgs e)
        {
         }
    
        public override List<string> ControlsToDestroy
        {
            get
            {
                // we should return none lazy controls only because lazy controls will be autodestroyed by parent container
                return new List<string>
                {
    
                };
            }
        }
    
        [DirectMethod]
        public void DirectMethod()
        {
    
        }
    
        [DirectMethod]
        public void jawLockingSave()
        {
            X.Msg.Alert("Message", CboJawLockingcboReason.SelectedItem.Text).Show();
    
            GroupTab gtp = new GroupTab();
            gtp = ((GroupTab)this.Parent.FindControl("GroupTabPanel1").FindControl("grpJawClicking"));
            gtp.SetActiveTab(0);
    
        }
    
    
    }
    ******************************************

    Thanks in advance
    Rupesh
Page 1 of 4 123 ... LastLast

Similar Threads

  1. Replies: 2
    Last Post: Feb 06, 2012, 9:06 AM
  2. Replies: 2
    Last Post: Dec 08, 2011, 1:00 PM
  3. [CLOSED] [1.0] User Control loaded several times
    By FVNoel in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jul 07, 2011, 10:33 AM
  4. [CLOSED] Dynamic loaded user control height problem
    By Suntico in forum 1.x Legacy Premium Help
    Replies: 10
    Last Post: Jun 27, 2011, 8:54 AM
  5. Replies: 2
    Last Post: Apr 15, 2010, 5:33 AM

Posting Permissions