Hi there,

While trying to dynamically load an user control inside another user control, im coming across this javascript error - Microsoft JScript runtime error: Expected ';'

Since the actual code block is large, I am providing some code snippets here so that you can check the implementation and can help me pointing out my possible mistake/s

Thanks in advance


Markup snippet of caller User Control (where im trying to load the other user control)


<ext:Panel ID="pnlUCProjectDetail" runat="server" Layout="FormLayout" Border="false" 
    AnchorHorizontal="100%" AutoHeight="true">
    <Content>
<%--        <uc1:UCAuditProjectDetail ID="UCAuditProjectDetail1" runat="server" />
--%>
    </Content>
</ext:Panel>
Code Behind snippet of caller User Control (where im trying to load the other user control)


/// This direct event is raised from command column of a grid that I have in above user control
        protected void LoadProjectDetail(object sender, DirectEventArgs e)
        {
            if (e.ExtraParams["Value"] != null && e.ExtraParams["OID"]!=null)
            {
                string oid = e.ExtraParams["OID"].ToString();

                AuditProject auditProject = (new AuditProjectManager(false)).GetAuditProjectByOID(oid);

                if (auditProject != null) 
                {
                    UserControl UCAuditProjectDetail1 = (UserControl)this.LoadControl("UCAuditProjectDetail.ascx");

                    //this.pnlUCProjectDetail.ContentControls.Clear();
                    UCAuditProjectDetail1.ID = "UCAuditProjectDetail1";

                    this.pnlUCProjectDetail.ContentControls.Add(UCAuditProjectDetail1);

                    ((UCAuditProjectDetail)UCAuditProjectDetail1).QACMeetingOID = QACMeetingOID;
                    ((UCAuditProjectDetail)UCAuditProjectDetail1).QACType = QACType;

                    ((UCAuditProjectDetail)UCAuditProjectDetail1).EditMode = EditMode;
                    ((UCAuditProjectDetail)UCAuditProjectDetail1).Implementation = Implementation;

                    ((UCAuditProjectDetail)UCAuditProjectDetail1).ObjectToForm(auditProject);

                    pnlUCAuditProjectList.Collapse(true);
                    pnlUCProjectDetail.Expand(true);

                    pnlUCProjectDetail.Render();
                }
            }
        }

Mark up snippet of the target User Control (UCAuditProjectDetail.ascx) that Im trying to load


<%@ Register Src="UCAuditParaList.ascx" TagName="UCAuditParaList" TagPrefix="uc2" %>

<ext:Hidden ID="hdnUCQACType" runat="server" />
<ext:Hidden ID="hdnUCQACOID" runat="server" />
<ext:Hidden ID="hdnEditMode" runat="server" />
<ext:Hidden ID="hdnImplementation" runat="server" />

<ext:FitLayout ID="FitLayout1" runat="server">
    <Items>
        <ext:Panel ID="pnlUCAuditProjectDetail" runat="server" Layout="FormLayout" Border="False"
            AnchorHorizontal="100%" AutoHeight="True" meta:resourcekey="pnlUCAuditProjectDetailResource1">
            <Items>
                <ext:FieldSet ID="pnlContainer" runat="server" Title="Project Info" Collapsible="true"
                    meta:resourcekey="pnlContainerResource2">
                    <Items>
                        <ext:Panel ID="pnlDetails1" runat="server" Layout="ColumnLayout" Border="true" AnchorHorizontal="100%"
                            Height="60" meta:resourcekey="pnlDetails1Resource1">
                            <Items>
                                <ext:Panel ID="Panel1" runat="server" Padding="5" Layout="FormLayout" ColumnWidth=".25"
                                    LabelAlign="Top" Border="false" meta:resourcekey="Panel1Resource1">
                                    <Items>
                                        <ext:TextField ID="txtUCEngagementCode" runat="server" FieldLabel="Engagement Code"
                                            Selectable="false" AnchorHorizontal="100%" meta:resourcekey="txtUCEngagementCodeResource2" />
                                    </Items>
                                </ext:Panel>
                                <ext:Panel ID="Panel2" runat="server" Padding="5" Layout="FormLayout" ColumnWidth=".25"
                                    LabelAlign="Top" Border="false" meta:resourcekey="Panel2Resource1">
                                    <Items>
                                        <ext:TextField ID="txtUCAuditableUnitName" runat="server" FieldLabel="Auditable Unit"
                                            Selectable="false" AnchorHorizontal="100%" meta:resourcekey="txtUCAuditableUnitNameResource2" />
                                    </Items>
                                </ext:Panel>
                                <ext:Panel ID="Panel3" runat="server" Padding="5" Layout="FormLayout" ColumnWidth=".25"
                                    LabelAlign="Top" Border="false" meta:resourcekey="Panel3Resource1">
                                    <Items>
                                        <ext:TextField ID="txtUCMinistryName" runat="server" FieldLabel="Ministry" Selectable="false"
                                            AnchorHorizontal="100%" meta:resourcekey="txtUCMinistryNameResource2" />
                                    </Items>
                                </ext:Panel>
                                <ext:Panel ID="Panel4" runat="server" Padding="5" Layout="FormLayout" ColumnWidth=".25"
                                    LabelAlign="Top" Border="false" meta:resourcekey="Panel4Resource1">
                                    <Items>
                                        <ext:TextField ID="txtUCTeamCode" runat="server" FieldLabel="Team Code" Selectable="false"
                                            AnchorHorizontal="100%" meta:resourcekey="txtUCTeamCodeResource2" />
                                    </Items>
                                </ext:Panel>
                            </Items>
                        </ext:Panel>
                        <ext:Panel ID="pnlAIRFileRef" runat="server" Layout="ColumnLayout" Border="false"
                            meta:resourcekey="pnlAIRFileRefResource1">
                            <Items>
                                <ext:GridPanel ID="grdAIRFileRef" runat="server" Title="AIR File References" AnchorHorizontal="100%"
                                    AutoScroll="false" ColumnWidth=".5" AutoWidth="true" Frame="true" StripeRows="true"
                                    Height="200px" Border="true" meta:resourcekey="grdAIRFileRefResource2">
                                    <Store>
                                        <ext:Store ID="storeAIRFileRef" runat="server" SerializationMode="Simple" meta:resourcekey="storeAIRFileRefResource1">
                                            <Reader>
                                                <ext:JsonReader IDProperty="OID">
                                                    <Fields>
                                                        <ext:RecordField Name="OID" Mapping="OID" Type="String" />
                                                        <ext:RecordField Name="RefFilePath" Mapping="RefFilePath" Type="String" />
                                                        <ext:RecordField Name="FileAlias" Mapping="FileAlias" Type="String" />
                                                    </Fields>
                                                </ext:JsonReader>
                                            </Reader>
                                        </ext:Store>
                                    </Store>
                                    <ColumnModel>
                                        <Columns>
                                            <ext:RowNumbererColumn Header="#" />
                                            <ext:Column DataIndex="FileAlias" Header="File Type" Width="220px" meta:resourcekey="FileAliasResource2" />
                                            <ext:CommandColumn Header="View" ButtonAlign="Center" meta:resourcekey="ViewCommandResource2">
                                                <Commands>
                                                    <ext:GridCommand Icon="Book" CommandName="View" Text="View" meta:resourcekey="ViewGridCommandResource2">
                                                        <ToolTip Text="View" />
                                                    </ext:GridCommand>
                                                </Commands>
                                            </ext:CommandColumn>
                                        </Columns>
                                    </ColumnModel>
                                    <BottomBar>
                                        <ext:PagingToolbar ID="PagingToolbar2" runat="server" PageSize="10" DisplayInfo="True"
                                            meta:resourcekey="PagingToolbar2Resource1" />
                                    </BottomBar>
                                    <DirectEvents>
                                        <Command OnEvent="Grid_AIR_File_Ref_Event" IsUpload="true">
                                            <ExtraParams>
                                                <ext:Parameter Name="OID" Value="record.id" Mode="Raw" />
                                                <ext:Parameter Name="CommandName" Value="command" Mode="Raw" />
                                            </ExtraParams>
                                        </Command>
                                    </DirectEvents>
                                </ext:GridPanel>
                                <ext:GridPanel ID="grdAIRSupplementaryFile" runat="server" Title="AIR Supplementary Files"
                                    AnchorHorizontal="100%" AutoScroll="false" ColumnWidth=".5" AutoWidth="true"
                                    Frame="true" StripeRows="true" Height="200px" Border="true" meta:resourcekey="grdAIRSupplementaryFileResource2">
                                    <Store>
                                        <ext:Store ID="storeAIRSupplementaryFile" runat="server" SerializationMode="Simple"
                                            meta:resourcekey="storeAIRSupplementaryFileResource1">
                                            <Reader>
                                                <ext:JsonReader IDProperty="OID">
                                                    <Fields>
                                                        <ext:RecordField Name="OID" Mapping="OID" Type="String" />
                                                        <ext:RecordField Name="RefFilePath" Mapping="RefFilePath" Type="String" />
                                                        <ext:RecordField Name="FileAlias" Mapping="FileAlias" Type="String" />
                                                    </Fields>
                                                </ext:JsonReader>
                                            </Reader>
                                        </ext:Store>
                                    </Store>
                                    <ColumnModel>
                                        <Columns>
                                            <ext:RowNumbererColumn Header="#" />
                                            <ext:Column DataIndex="FileAlias" Header="File Name" Width="220px" meta:resourcekey="FileAliasResource1" />
                                            <ext:CommandColumn Header="View" ButtonAlign="Center" meta:resourcekey="ViewCommandResource1">
                                                <Commands>
                                                    <ext:GridCommand Icon="Book" CommandName="View" Text="View" meta:resourcekey="ViewGridCommandResource1">
                                                        <ToolTip Text="View" />
                                                    </ext:GridCommand>
                                                </Commands>
                                            </ext:CommandColumn>
                                        </Columns>
                                    </ColumnModel>
                                    <BottomBar>
                                        <ext:PagingToolbar ID="PagingToolbar1" runat="server" PageSize="10" DisplayInfo="True"
                                            meta:resourcekey="PagingToolbar1Resource1" />
                                    </BottomBar>
                                    <DirectEvents>
                                        <Command OnEvent="Grid_AIR_Supplementary_File_Event" IsUpload="true">
                                            <ExtraParams>
                                                <ext:Parameter Name="OID" Value="record.id" Mode="Raw" />
                                                <ext:Parameter Name="CommandName" Value="command" Mode="Raw" />
                                            </ExtraParams>
                                        </Command>
                                    </DirectEvents>
                                </ext:GridPanel>
                            </Items>
                        </ext:Panel>
                    </Items>
                </ext:FieldSet>
                <ext:Panel ID="Panel5" runat="server" Layout="FormLayout" Border="false" Title="Para List"
                    AnchorHorizontal="100%" AutoHeight="true" meta:resourcekey="Panel5Resource2">
                    <Content>
                        <uc2:UCAuditParaList ID="UCAuditParaList1" runat="server" ShowSearchParam="false"
                            SelectionModel="DefaultSelectionModel" />
                    </Content>
                </ext:Panel>
            </Items>
        </ext:Panel>
    </Items>
</ext:FitLayout>