problem while loading user control ,Direct Method for that control is not working

  1. #1

    problem while loading user control ,Direct Method for that control is not working

    hi
    i have problem while loading user control ,save button for that control not working
    plz go through this coding

    Main Page aspx here
    <%@ Page Title="" Language="C#" AutoEventWireup="true" CodeFile="PatientFollowup.aspx.cs"
        Inherits="Doctors_PatientFollowup" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" title="followup" 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="MainForm" runat="server" style="background-color: White">
        
        <ext:ResourceManager ID="ResourceManager1" runat="server">
        </ext:ResourceManager>
        <div>
            <ext:Window runat="server" ID="winpopup" Height="560" Width="600" Hidden="true" Modal="true">
               
            </ext:Window>
            
            <ext:Store ID="StoreSymptoms" runat="server">
                <Reader>
                    <ext:ArrayReader IDProperty="Symptoms">
                        <Fields>
                            <ext:RecordField Name="Symptoms" Type="String">
                            </ext:RecordField>
                            <ext:RecordField Name="sLocation" Type="String">
                            </ext:RecordField>
                        </Fields>
                    </ext:ArrayReader>
                </Reader>
            </ext:Store>
            <ext:Viewport ID="Viewport1" runat="server" AutoScroll="true">
                <Items>
                    <ext:Panel ID="MainBorderLayoutPanel" AutoWidth="true" HideBorders="true" runat="server"
                        Border="false" Closable="false" Collapsible="false" HideCollapseTool="true" DefaultCollapsible="false"
                        BodyStyle="background-color: White" Layout="border" Height="800px" AutoScroll="true"
                        Width="1280">
                        <Items>
                            <ext:BorderLayout ID="MainBorderLayout" runat="server">
                                <North>
                                    <ext:Panel ID="HolderNorthPanel" runat="server" Height="115px" Border="false" BodyStyle="overflow:visible">
                                        <Items>
                                            <ext:Panel runat="server" ID="HeaderHolderPanel" Height="80px" Border="false">
                                            </ext:Panel>
                                            <ext:Panel BodyStyle="overflow:visible" runat="server" Width="1250" ID="MenuHolderPanel"
                                                Height="35px" Border="true" BodyBorder="true">
                                            </ext:Panel>
                                        </Items>
                                    </ext:Panel>
                                </North>
                                <West CMarginsSummary="0 5" MarginsSummary="0 5">
                                    <ext:Panel ID="HolderWestPanel" runat="server" Width="250px" BodyStyle="background-color:white"
                                        Collapsed="true" Collapsible="true" Title="Side Menu" Icon="FolderGo" AutoHeight="true"
                                        AutoScroll="true">
                                    </ext:Panel>
                                </West>
                                <Center CMarginsSummary="0 5" MarginsSummary="0 5" MinHeight="800px" MinWidth="300px"
                                    MaxWidth="1200px">
                                    <ext:Panel ID="HolderCenterPanel" runat="server" Border="false" AutoHeight="true"
                                        BodyStyle="background-color:white">
                                        <Items>
                                            <ext:TabPanel ID="TabPanel1" runat="server" Title="TabPanel" ActiveTabIndex="0" TabAlign="Left"
                                                TabPosition="Top" Border="false" Height="625" AutoScroll="true" DeferredRender="true"
                                                BodyStyle="border:1px solid #AABBCC; border-top: none;">
                                                <Items>
                                                    <ext:Panel ID="TabFollowup" runat="server" Title="Followup" BodyStyle="background-color:#DDEEFF;"
                                                        Layout="Fit" ButtonAlign="Center">
                                                        <Items>
                                                            <ext:GroupTabPanel ID="GroupTabPanel1" runat="server" TabWidth="220" Cls="vertical-tabs"
                                                                AutoScroll="true" BodyStyle="border:1px solid #82ACCE;">
                                                                <Groups>
                                                                    <ext:GroupTab ID="grpQuestionaaaire" runat="server">
                                                                        <Items>
                                                                            <ext:Panel ID="pnlQuestionaaaire" runat="server" Title="Questionnaire" TabTip="Questionnaire"
                                                                                StyleSpec="padding:5px;">
                                                                                <Items>
                                                                                    <ext:Panel ID="EarPainPanel1" runat="server" Title="Questionnaire" Padding="5" BodyBorder="true"
                                                                                        Width="980" Height="520" LabelWidth="150" ButtonAlign="Center" Layout="Column">
                                                                                        <Items>
                                                                                            <ext:Panel ID="Panel1" ColumnWidth="0.7" runat="server" Padding="3">
                                                                                                <Items>
                                                                                                    <ext:GridPanel ID="grdQuestion" runat="server" Title="Old Symptoms Details" Height="415"
                                                                                                        Frame="true" AutoWidth="true" AutoExpandColumn="Symptoms" AnchorHorizontal="100%"
                                                                                                        StoreID="StoreSymptoms">
                                                                                                        <ColumnModel ID="columnmodel2" runat="server">
                                                                                                            <Columns>
                                                                                                                <ext:Column ColumnID="Symptoms" Width="100" Header="Symptoms" DataIndex="Symptoms">
                                                                                                                </ext:Column>
                                                                                                                <ext:Column ColumnID="sLocation" Width="100" Header="Location" DataIndex="sLocation">
                                                                                                                </ext:Column>
                                                                                                                <ext:Column ColumnID="sWorse" Width="100" Header="Worse" DataIndex="sLocation">
                                                                                                                </ext:Column>
                                                                                                                <ext:CommandColumn Width="80" Header="No Change" Align="Center">
                                                                                                                    <Commands>
                                                                                                                        <ext:GridCommand Icon="ArrowEw" Text="No Change" CommandName="NoChange">
                                                                                                                            <ToolTip Text="Click To Edit" />
                                                                                                                        </ext:GridCommand>
                                                                                                                    </Commands>
                                                                                                                </ext:CommandColumn>
                                                                                                                <ext:CommandColumn Width="60" Header="Better" Align="Center">
                                                                                                                    <Commands>
                                                                                                                        <ext:GridCommand Icon="ArrowUp" Text="Better" CommandName="Better">
                                                                                                                            <ToolTip Text="Click To Edit" />
                                                                                                                        </ext:GridCommand>
                                                                                                                    </Commands>
                                                                                                                </ext:CommandColumn>
                                                                                                                <ext:CommandColumn Width="60" Header="Cure" Align="Center">
                                                                                                                    <Commands>
                                                                                                                        <ext:GridCommand Icon="Accept" Text="Cure" CommandName="Cure">
                                                                                                                        </ext:GridCommand>
                                                                                                                    </Commands>
                                                                                                                </ext:CommandColumn>
                                                                                                            </Columns>
                                                                                                           </ColumnModel>
                                                                                                        
                                                                                                        <Listeners>
                                                                                                            <Command Handler="#{DirectMethods}.DisplayJawClicking(record.data.Symptoms,command);" />
                                                                                                        </Listeners>
                                                                                                    </ext:GridPanel>
                                                                                                </Items>
                                                                                            </ext:Panel>
                                                                                            <ext:Panel ID="Panel2" runat="server" ColumnWidth="0.3" Padding="5">
                                                                                                <Items>
                                                                                                    <ext:Container ID="Container1" runat="server" LabelAlign="Top" Layout="Form">
                                                                                                        <Items>
                                                                                                            <ext:TextArea runat="server" ID="txtQuestTreatmentPlan" FieldLabel="Treatment Plan"
                                                                                                                StyleSpec="font: normal 11px  arial;text-decoration:none;" Width="280" Height="180"
                                                                                                                ReadOnly="true">
                                                                                                            </ext:TextArea>
                                                                                                        </Items>
                                                                                                    </ext:Container>
                                                                                                    <ext:Container ID="Container2" runat="server" LabelAlign="Top" Layout="Form">
                                                                                                        <Items>
                                                                                                            <ext:TextArea runat="server" ID="txtQuestDiagnosis" StyleSpec="font: normal 11px arial;"
                                                                                                                FieldLabel="Diagnosis" Width="280" Height="180" ReadOnly="true">
                                                                                                            </ext:TextArea>
                                                                                                        </Items>
                                                                                                    </ext:Container>
                                                                                                </Items>
                                                                                            </ext:Panel>
                                                                                        </Items>
                                                                                    </ext:Panel>
                                                                                </Items>
                                                                            </ext:Panel>
                                                                        </Items>
                                                                    </ext:GroupTab>
                                                                </Groups>
                                                            </ext:GroupTabPanel>
                                                        </Items>
                                                    </ext:Panel>
                                                </Items>
                                            </ext:TabPanel>
                                        </Items>
                                    </ext:Panel>
                                </Center>
                                <South MaxHeight="100" CMarginsSummary="10 0" MarginsSummary="10 0">
                                    <ext:Panel ID="HolderSouthPanel" runat="server" BodyStyle="background-color:white"
                                        Border="true" BodyBorder="true" AutoHeight="true">
                                        <Content>
                                            <div id="footer">
                                                <%-- <UC:Footer ID="ucFooter" runat="server" />--%>
                                            </div>
                                        </Content>
                                    </ext:Panel>
                                </South>
                            </ext:BorderLayout>
                        </Items>
                    </ext:Panel>
                </Items>
            </ext:Viewport>
        </div>
        </form>
    </body>
    </html>
    and main page aspx.cs

    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.IO;
    using System.Xml;
    using System.Data;
    
    public partial class Doctors_PatientFollowup : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
                BindData();
    
          
            //StringBuilder sb = new StringBuilder();
    
           
    
            
        }
    
        [DirectMethod(ViewStateMode = ViewStateMode.Enabled)]
        public void EditComplaints(string s)
        {
            GetSetGroupFunction.followselopt = s;
    
            X.Js.Call("destroyFromCache", new JRawValue(winpopup.ClientID));
            if (GetSetGroupFunction.followselopt == "JawLocking")
            {
                BaseUserControl uc2 = (BaseUserControl)this.FindControl("UC2");
                X.Js.Call("putToCache", new JRawValue(winpopup.ClientID), uc2.ControlsToDestroy);
            }
            if (GetSetGroupFunction.followselopt == "JawLocking")
            {
                BaseUserControl uc2 = (BaseUserControl)this.FindControl("UC3");
                X.Js.Call("putToCache", new JRawValue(winpopup.ClientID), uc2.ControlsToDestroy);
            }
    
    
            this.winpopup.UpdateContent();
    
            winpopup.Show();
            //win.Show();
        }
    
        private void BindData()
        {
            StoreSymptoms.DataSource = this.Data;
            StoreSymptoms.DataBind();
            //grdQuestion.Store.Primary.DataSource = this.Data;
            //grdQuestion.Store.Primary.DataBind(); 
        }
        [DirectMethod]
        public void DisplayJawClicking(string sSymptoms, string optid)
        {
    
    
            X.Js.Call("destroyFromCache", new JRawValue(winpopup.ClientID));
            BaseUserControl uc = new BaseUserControl();
            if (sSymptoms == "JawClicking")
            {
                BaseUserControl uc2 = (BaseUserControl)this.LoadControl("~/UserControl/JawClicking.ascx");
                uc2.ID = "JawClickingUC";
                uc = uc2;
            }
            if (sSymptoms == "JawLocking")
            {
                BaseUserControl uc4 = (BaseUserControl)this.LoadControl("~/UserControl/JawLockingControl.ascx");
                uc4.ID = "JawLockingUC";
                uc = uc4;
            }
            if (sSymptoms == "JawPain")
            {
                BaseUserControl uc5 = (BaseUserControl)this.LoadControl("~/UserControl/JawPain.ascx");
                uc5.ID = "JawPain";
                uc = uc5;
            }
            this.winpopup.ContentControls.Add(uc);
            X.Js.Call("putToCache", new JRawValue(winpopup.ClientID), uc.ControlsToDestroy);
    
            this.winpopup.ContentControls.Add(uc);
            this.winpopup.UpdateContent();
            winpopup.Modal = true;
            winpopup.Show();
    
        }
    
        private object[] Data
        {
            get
            {
                DateTime now = DateTime.Now;
    
                return new object[]
                {
                    new object[] { "JawClicking", "Right" },
                    new object[] { "JawLocking", "Left" },
                    new object[]{"JawPain","Right"}
                };
            }
        }
    }

    In this page u will find grid control which contain records like jawclicking,jawlocking,jawpain and command button for Nochange,Better,cure and i have seperate user controls for jawclicking,jawlocking,jawpain etc.thease controls are like this,
    jawclicking.aspx
    <%@ 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="600" Height="470" ButtonAlign="Center">
        <Items>
            <ext:Panel ID="jawclickPanel7" runat="server" Frame="true" Width="580" BodyStyle="background-color:transparent;"
                ButtonAlign="Center">
                <Items>
                <ext:Hidden ID="hdnJawLockingParam" runat="server" >
                
                </ext:Hidden>
                <ext:Hidden ID="hdnJawLockingStatus" runat="server">
                </ext:Hidden>
                    <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>
                            
                        </Items>
                    </ext:Container>
                </Items>
            </ext:Panel>
            <ext:DisplayField ID="jawclickDisplayField5" runat="server" Height="5">
            </ext:DisplayField>
            <ext:Panel ID="jawclickPanel3" runat="server" Layout="Column" BodyBorder="false"
                Width="1020" Height="120">
                <Items>
                    <ext:Panel runat="server" ColumnWidth="0.33" BodyBorder="false">
                        <Items>
                            <ext:Panel ID="jawclickLocation" runat="server" Title="Location" Collapsible="false"
                                Border="true" Width="330px" Padding="3">
                                <Items>
                                    <ext:RadioGroup ID="jawclickRdLocation" runat="server" ColumnsNumber="4" BlankText="select One">
                                        <Items>
                                            <ext:Radio ID="jawclickrdLeft" runat="server" BoxLabel="Left" GroupName="RdLocation">
                                            </ext:Radio>
                                            <ext:Radio ID="jawclickrdRight" runat="server" BoxLabel="Right" GroupName="RdLocation">
                                            </ext:Radio>
                                            <ext:Radio ID="jawclickrdBoth" runat="server" BoxLabel="Both" GroupName="RdLocation">
                                            </ext:Radio>
                                            <ext:Radio ID="jawclickrdNA" runat="server" BoxLabel="NA" GroupName="RdLocation">
                                            </ext:Radio>
                                        </Items>
                                    </ext:RadioGroup>
                                </Items>
                            </ext:Panel>
                            
                        </Items>
                    </ext:Panel>
                    
                </Items>
            </ext:Panel>
           
            <ext:Panel ID="jawclickPanel5" runat="server" Layout="Column" Height="190" BodyBorder="false"
                Width="1020">
                <Items>
                    <ext:Panel ID="jawclickPanel6" runat="server" ColumnWidth="0.33" BodyBorder="false">
                        <Items>
                            <ext:Panel ID="jawclickFdPainCat" runat="server" Title="Pain Category" Padding="5"
                                Collapsible="false" Width="330px" Border="true">
                                <Items>
                                    <ext:CheckboxGroup ID="jawclickchkPainCategory" runat="server" ColumnsNumber="3"
                                        BlankText="select One">
                                        <Items>
                                            <ext:Checkbox ID="jawclickckAching" runat="server" BoxLabel="Aching">
                                            </ext:Checkbox>
                                            <ext:Checkbox ID="jawclickckDull" runat="server" BoxLabel="Dull">
                                            </ext:Checkbox>
                                            <ext:Checkbox ID="jawclickckTightness" runat="server" BoxLabel="Tightness">
                                            </ext:Checkbox>
                                            <ext:Checkbox ID="jawclickckIntense" runat="server" BoxLabel="Intense">
                                            </ext:Checkbox>
                                            <ext:Checkbox ID="jawclickckSharp" runat="server" BoxLabel="Sharp">
                                            </ext:Checkbox>
                                        </Items>
                                    </ext:CheckboxGroup>
                                </Items>
                            </ext:Panel>
                            
                        </Items>
                    </ext:Panel>
                    
                </Items>
            </ext:Panel>
            <ext:DisplayField ID="jawclickDisplayField7" runat="server" Height="2">
            </ext:DisplayField>
        </Items>
    </ext:Panel>
    <ext:Panel ID="pnlJawClickButton" runat="server" BodyBorder="false" Height="30" Width="580" ButtonAlign="Center">
        <Buttons>
            <ext:Button Text="Save" runat="server">
                <Listeners>
                    <Click Handler="#{DirectMethods}.JawClickAdd();" />
                </Listeners>
            </ext:Button>
        </Buttons>
        
    </ext:Panel>

    Jawclicking.aspx.cs
    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 JawClickAdd()
        {
            string _s = "Reason Of Visit Is " + jawclickcboReason.SelectedItem.Text;
            _s = _s + " Location Is " + GetSetGroupFunction.GetRadioGroupValue(jawclickRdLocation);
            _s= _s + " Pain Category Are " + GetSetGroupFunction.GetCheckGroupValue(jawclickchkPainCategory);
            X.Msg.Alert("Values", _s).Show();
            ((Window)this.Parent.FindControl("winpopup")).Hide();
    
           
        }
      
    }
    jawlocking.aspx
    <%@ 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="600"
        Height="450">
        <Items>
            <ext:Panel ID="PnlJawLockingInner" runat="server" Frame="true" Width="580" BodyStyle="background-color:transparent;"
                ButtonAlign="Center" >
                <Items>
                <ext:Hidden ID="hdnJawLocking" runat="server"></ext:Hidden>
                <ext:Hidden ID="hdnJawLockingStatus" runat="server"></ext:Hidden>
                    <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>
                       
                        </Items>
                    </ext:Container>
                </Items>
            </ext:Panel>
            <ext:DisplayField ID="dspFd1" runat="server" Height="5">
            </ext:DisplayField>
            <ext:Panel ID="pnlJLOccuranceMain" runat="server" Layout="Column" BodyBorder="false"
                Height="130" Width="580">
                <Items>
                    
                    <ext:Panel ID="pnlJLLocationMain" runat="server" ColumnWidth="0.33" BodyBorder="false" >
                        <Items>
                            <ext:Panel ID="pnlJLLocationSub" runat="server" Title="Location" Collapsible="false"
                                Width="330px" BodyBorder="true" Padding="5">
                                <Items>
                                    <ext:RadioGroup ID="rdGrpJLLocation" runat="server" ColumnsNumber="4" BlankText="select One">
                                        <Items>
                                            <ext:Radio ID="jawclickrdLeft" runat="server" BoxLabel="Left" GroupName="JLLocation">
                                            </ext:Radio>
                                            <ext:Radio ID="jawclickrdRight" runat="server" BoxLabel="Right" GroupName="JLLocation">
                                            </ext:Radio>
                                            <ext:Radio ID="jawclickrdBoth" runat="server" BoxLabel="Both" GroupName="JLLocation">
                                            </ext:Radio>
                                            <ext:Radio ID="jawclickrdNA" runat="server" BoxLabel="NA" GroupName="JLLocation">
                                            </ext:Radio>
                                        </Items>
                                    </ext:RadioGroup>
                                    
                                </Items>
                            </ext:Panel>
                            
                        </Items>
                    </ext:Panel>
                    
                </Items>
            </ext:Panel>
            
            
            <ext:Panel ID="pnlJLPainCategory" runat="server" Title="Pain Category" 
                Collapsible="false" BodyBorder="true" Width="580" >
                <Items>
                    <ext:CheckboxGroup ID="chkGrpJLPainCategory" runat="server" ColumnsNumber="5" BlankText="select One"
                        StyleSpec="padding-left:9px;">
                        <Items>
                            <ext:Checkbox ID="chkJLPainCategoryAching" runat="server" BoxLabel="Aching">
                            </ext:Checkbox>
                            <ext:Checkbox ID="chkJLPainCategoryAnnoying" runat="server" BoxLabel="Annoying">
                            </ext:Checkbox>
                            <ext:Checkbox ID="chkJLPainCategoryBeating" runat="server" BoxLabel="Beating">
                            </ext:Checkbox>
                            <ext:Checkbox ID="chkJLPainCategoryDreawing" runat="server" BoxLabel="Dreawing">
                            </ext:Checkbox>
                            <ext:Checkbox ID="chkJLPainCategoryDull" runat="server" BoxLabel="Dull">
                            </ext:Checkbox>
                            <ext:Checkbox ID="chkJLPainCategoryHeavy" runat="server" BoxLabel="Heavy">
                            </ext:Checkbox>
                            <ext:Checkbox ID="chkJLPainCategoryHurting" runat="server" BoxLabel="Hurting">
                            </ext:Checkbox>
                            <ext:Checkbox ID="chkJLPainCategoryIntensed" runat="server" BoxLabel="Intensed">
                            </ext:Checkbox>
                            <ext:Checkbox ID="chkJLPainCategoryMiserable" runat="server" BoxLabel="Miserable">
                            </ext:Checkbox>
                            <ext:Checkbox ID="chkJLPainCategoryNumb" runat="server" BoxLabel="Numb">
                            </ext:Checkbox>
                            <ext:Checkbox ID="chkJLPainCategoryPounding" runat="server" BoxLabel="Pounding">
                            </ext:Checkbox>
                            <ext:Checkbox ID="chkJLPainCategorySore" runat="server" BoxLabel="Sore">
                            </ext:Checkbox>
                            <ext:Checkbox ID="chkJLPainCategorySqueezing" runat="server" BoxLabel="Squeezing">
                            </ext:Checkbox>
                            <ext:Checkbox ID="chkJLPainCategoryTearing" runat="server" BoxLabel="Tearing">
                            </ext:Checkbox>
                            <ext:Checkbox ID="chkJLPainCategoryThrobbing" runat="server" BoxLabel="Throbbing">
                            </ext:Checkbox>
                            <ext:Checkbox ID="chkJLPainCategoryTight" runat="server" BoxLabel="Tight">
                            </ext:Checkbox>
                            <ext:Checkbox ID="chkJLPainCategoryTroublesome" runat="server" BoxLabel="Troublesome">
                            </ext:Checkbox>
                            <ext:Checkbox ID="chkJLPainCategoryUnbearable" runat="server" BoxLabel="Unbearable">
                            </ext:Checkbox>
                        </Items>
                    </ext:CheckboxGroup>
                </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>
    jawlocking.aspx.cs

    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 System.Data;
    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()
        {
            
            string _s ="Reason of Visit is " + CboJawLockingcboReason.SelectedItem.Text;
            _s = _s + " Location Is " + GetSetGroupFunction.GetRadioGroupValue(rdGrpJLLocation);
            _s = _s + " Pain Category Are " + GetSetGroupFunction.GetCheckGroupValue(chkGrpJLPainCategory);
            X.Msg.Alert("CheckGroup", _s).Show(); ;
    
            ((Window)this.Parent.FindControl("winpopup")).Hide();
        }
    
    
    
    }
    jawpain.aspx page here
    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="JawPain.ascx.cs" Inherits="UserControl_JawPain" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <ext:Panel ID="pnlJPMain" runat="server" ButtonAlign="Center" Title="Jaw Pain" Padding="5"
        BodyBorder="true" Width="1040" Height="460">
        <Items>
            <ext:Panel ID="pnlJPSub" runat="server" Frame="true" Width="1000" BodyStyle="background-color:transparent;"
                ButtonAlign="Center">
                <Items>
                    <ext:Hidden ID="hdnJawPain" runat="server">
                    </ext:Hidden>
                    <ext:Hidden ID="hdnJawPainStatus" runat="server">
                    </ext:Hidden>
                    <ext:Container ID="cntJPOuter" runat="server" Layout="Column" Height="40" BodyStyle="background-color:#fff;">
                        <Items>
                            <ext:Container ID="cntJPVisitReason" runat="server" LabelAlign="Top" Layout="Form"
                                ColumnWidth=".33">
                                <Items>
                                    <ext:ComboBox ID="cboJPVisitReason" ForceSelection="false" runat="server" FieldLabel="Reason of Visit"
                                        LabelStyle="color:#284382;font-weight:bold;" AnchorHorizontal="98%" SelectedIndex="0">
                                        <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" />
                                        </Items>
                                    </ext:ComboBox>
                                </Items>
                            </ext:Container>
                            <ext:Container ID="cntJPPainReason" runat="server" LabelAlign="Top" Layout="Form"
                                ColumnWidth=".33">
                                <Items>
                                    <ext:ComboBox ID="CboJPPainReason" ForceSelection="false" runat="server" FieldLabel="Reason of Jaw Pain"
                                        LabelStyle="color:#284382;font-weight:bold;" AnchorHorizontal="98%" SelectedIndex="0">
                                        <Items>
                                            <ext:ListItem Text="Select" Value="Select" />
                                            <ext:ListItem Text="Stress" Value="Stress" />
                                            <ext:ListItem Text="Trauma" Value="Trauma" />
                                            <ext:ListItem Text="Arthritis" Value="Arthritis" />
                                            <ext:ListItem Text="Others" Value="Others" />
                                        </Items>
                                    </ext:ComboBox>
                                </Items>
                            </ext:Container>
                            <ext:Container ID="cntJPSymptoms" runat="server" LabelAlign="Top" Layout="Form" ColumnWidth=".33">
                                <Items>
                                    <ext:ComboBox ID="cboJPSymptoms" ForceSelection="false" runat="server" FieldLabel="When Symtomps Started?"
                                        LabelStyle="color:#284382;font-weight:bold;" AnchorHorizontal="95%" SelectedIndex="0">
                                        <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" />
                                        </Items>
                                    </ext:ComboBox>
                                </Items>
                            </ext:Container>
                        </Items>
                    </ext:Container>
                </Items>
            </ext:Panel>
            <ext:DisplayField ID="dspFd" runat="server" Height="5">
            </ext:DisplayField>
         
              <ext:Panel ID="pnlJPPainCategory" runat="server" Title="Pain Category" Padding="5"
                Collapsible="false" Width="1000" BodyBorder="true">
                <Items>
                    <ext:CheckboxGroup ID="chkGrpJPPainCategory" runat="server" ColumnsNumber="10" BlankText="select One">
                        <Items>
                            <ext:Checkbox ID="chkGrpJPPainCategoryAching" runat="server" BoxLabel="Aching">
                            </ext:Checkbox>
                            <ext:Checkbox ID="chkGrpJPPainCategoryAnnoying" runat="server" BoxLabel="Annoying">
                            </ext:Checkbox>
                            <ext:Checkbox ID="chkGrpJPPainCategoryBeating" runat="server" BoxLabel="Beating">
                            </ext:Checkbox>
                            <ext:Checkbox ID="chkGrpJPPainCategoryDreawing" runat="server" BoxLabel="Dreawing">
                            </ext:Checkbox>
                            <ext:Checkbox ID="chkGrpJPPainCategoryDull" runat="server" BoxLabel="Dull">
                            </ext:Checkbox>
                            <ext:Checkbox ID="chkGrpJPPainCategoryHeavy" runat="server" BoxLabel="Heavy">
                            </ext:Checkbox>
                            <ext:Checkbox ID="chkGrpJPPainCategoryHurting" runat="server" BoxLabel="Hurting">
                            </ext:Checkbox>
                            <ext:Checkbox ID="chkGrpJPPainCategoryIntensed" runat="server" BoxLabel="Intensed">
                            </ext:Checkbox>
                            <ext:Checkbox ID="chkGrpJPPainCategoryMiserable" runat="server" BoxLabel="Miserable">
                            </ext:Checkbox>
                            <ext:Checkbox ID="chkGrpJPPainCategoryNumb" runat="server" BoxLabel="Numb">
                            </ext:Checkbox>
                            <ext:Checkbox ID="chkGrpJPPainCategoryPounding" runat="server" BoxLabel="Pounding">
                            </ext:Checkbox>
                            <ext:Checkbox ID="chkGrpJPPainCategorySore" runat="server" BoxLabel="Sore">
                            </ext:Checkbox>
                            <ext:Checkbox ID="chkGrpJPPainCategorySqueezing" runat="server" BoxLabel="Squeezing">
                            </ext:Checkbox>
                            <ext:Checkbox ID="chkGrpJPPainCategoryTearing" runat="server" BoxLabel="Tearing">
                            </ext:Checkbox>
                            <ext:Checkbox ID="chkGrpJPPainCategoryThrobbing" runat="server" BoxLabel="Throbbing">
                            </ext:Checkbox>
                            <ext:Checkbox ID="chkGrpJPPainCategoryTight" runat="server" BoxLabel="Tight">
                            </ext:Checkbox>
                            <ext:Checkbox ID="chkGrpJPPainCategoryTroublesome" runat="server" BoxLabel="Troublesome">
                            </ext:Checkbox>
                            <ext:Checkbox ID="chkGrpJPPainCategoryUnbearable" runat="server" BoxLabel="Unbearable">
                            </ext:Checkbox>
                        </Items>
                    </ext:CheckboxGroup>
                </Items>
            </ext:Panel>
        </Items>
    </ext:Panel>
    <ext:Panel ID="pnlJawPainButton" runat="server" BodyBorder="false" Height="30" Width="1020"
        ButtonAlign="Center">
        <Buttons>
            <ext:ImageButton ID="JawPainSave" ImageUrl="../images/save.png" runat="server">
                <Listeners>
                    <Click Handler="#{DirectMethods}.jawPainSave();" />
                </Listeners>
            </ext:ImageButton>
        </Buttons>
        
    </ext:Panel>
    jawpain.aspx.cs here
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using Ext.UC;
    using Ext.Net;
    public partial class UserControl_JawPain :BaseUserControl
    {
        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 jawPainSave()
        {
    
            string _s = "Reason of Visit is " + CboJPPainReason.SelectedItem.Text;
          
            _s = _s + " Pain Category Are " + GetSetGroupFunction.GetCheckGroupValue(chkGrpJPPainCategory);
            X.Msg.Alert("CheckGroup", _s).Show(); ;
            ((Window)this.Parent.FindControl("winpopup")).Hide();
    
        }
    
    
    
    }
    baseusercontrol.cs
    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>();
                }
            }
    
    
        }
    }
    GetsetGroupFunction.cs
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using Ext.Net;
    /// <summary>
    /// Summary description for GetSetGroupFunction
    /// </summary>
    public static class GetSetGroupFunction
    {
        public static string followselopt = "";
        /// <summary>
        /// This function is used to get Box Label of selected option (Ext.radio control) from Ext.RadioGroup (rdg)
        /// </summary>
        /// <param name="rdg"></param>
        /// <returns>string of selected box label</returns>
        public static string GetRadioGroupValue(RadioGroup rdg)
        {
            string _sReturn="";
            foreach (Radio rd in rdg.CheckedItems)
            {
                _sReturn += rd.BoxLabel;
            }
            return _sReturn;
        }
    
        /// <summary>
        /// This function is used to set Box Label as selected (Ext.radio control) from Ext.RadioGroup (rdg) which is match with string parameter(_sValue).
        /// </summary>
        /// <param name="rdg"></param>
        /// <param name="_sValue"></param>
        public static void SetRadioGroupValue(RadioGroup rdg, string _sValue)
        {
            foreach (Radio rd in rdg.Items)
            {
                if (_sValue.ToLower() == rd.BoxLabel.ToLower())
                    rd.Checked = true;
                else
                    rd.Checked = false;
            }
        }
        /// <summary>
        /// This function is used to get comma seperated Box Label of selected options (Ext.Checkbox control) from Ext.CheckboxGroup (chkg)
        /// </summary>
        /// <param name="chkg"></param>
        /// <returns>comma seperated string of selected box label</returns>
        public static string GetCheckGroupValue(CheckboxGroup chkg)
        {
            string _sReturn = "";
            foreach (Checkbox chk in chkg.CheckedItems)
            {
                _sReturn += chk.BoxLabel + ",";
            }
            if (_sReturn.Length > 0)
                _sReturn = _sReturn.Substring(0, _sReturn.Length-1);
            return _sReturn;
        }
        
        /// <summary>
        /// This function is used to set Box Label as selected (Ext.Checkbox control) from Ext.CheckboxGroup (chkg) 
        /// which is match with comma seperated string parameter (_sValue).
        /// </summary>
        /// <param name="chkg"></param>
        /// <param name="_sValue"></param>
        public static void SetCheckGroupValue(CheckboxGroup chkg, string _sValue)
        {
            _sValue="," + _sValue.ToLower() + ",";
            foreach (Checkbox chk in chkg.Items)
            {
                if (_sValue.Contains("," + chk.BoxLabel.ToLower() + ","))
                    chk.Checked = true;
                else
                    chk.Checked = false;
            }
        }
    }
    thanx
    archana
  2. #2
    Hi archana,

    You must simplify your code sample. Please only post one simplified .aspx (+ a .ascx if required). Unfortunately we will not be able to devote the resources to gluing together this many files.
    Geoffrey McGill
    Founder
  3. #3
    Hi
    sorry for ur inconvenience,
    Actually except first main file, all files are JawClicking .ascx ,Jawclicking.ascx.cs,JawLocking.ascx ,JawLocking.ascx.cs,JawPain.ascx,JawPain.ascx.cs
    Last edited by archana mahadule; Jan 17, 2011 at 6:53 AM.
  4. #4
    Hi to all,
    Anybody knows solution for this Problem? if yes,plz send it as soon as possible,it's urgent...plz..plz..

    thanx,
    archana
  5. #5
    Hi guys,

    Any Updates,it's urgent ,plz send it as early as possible ,plz..

    thanx
    @rchana
  6. #6
    Hi rchana,

    Unfortunately I was unable to get your code sample working.

    Please see 5B at the following location:

    http://forums.ext.net/showthread.php...ing-New-Topics

    Would be worth the time to review the following guidelines as well, see

    http://forums.ext.net/showthread.php...ation-Required
    Geoffrey McGill
    Founder
  7. #7
    Hi ,

    Any update ? plz send me response quickly ,plz...


    thanx
    @rchana
  8. #8
    Hi
    Any updates ? plz reply me quicky .


    thanks
    archana
  9. #9
    Quote Originally Posted by archana mahadule View Post
    Hi
    Any updates ? plz reply me quicky .


    thanks
    archana
    Unfortunately we do not have any updates for you.
    Geoffrey McGill
    Founder

Similar Threads

  1. Replies: 0
    Last Post: May 16, 2012, 11:29 PM
  2. Replies: 2
    Last Post: Feb 06, 2012, 9:06 AM
  3. Replies: 2
    Last Post: Oct 12, 2011, 7:49 AM
  4. [CLOSED] Problem loading user control from code behind
    By jmcantrell in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Jul 18, 2011, 9:02 PM
  5. Replies: 8
    Last Post: Jun 24, 2010, 9:39 PM

Posting Permissions