RADAjax Manager does not load JS files in dynamically loaded user control

66 posts, 0 answers
  1. Rohan
    Rohan avatar
    94 posts
    Member since:
    Jul 2012

    Posted 20 Oct 2012 Link to this post

    Hi all,

     

    I have  following scenario.

    I am using the radgrid with Edit Usercontrol.

    In user control we do some operation and show the status of operation via RADWindow …

    My problem is – when I am showing the message using the RADWINDOW my page gets postback and I lost my current page position so I need to again scroll the page.

    I also try for RadAjaxPanel – it gives me exception like

    Please, see whether wrapping the code block, generating the exception, within RadCodeBlock resolves the error.

     

    And Exception details are

    DotNetNuke.Services.Exceptions.PageLoadException: Please, see whether wrapping the code block, generating the exception, within RadCodeBlock resolves the error. ---> System.Web.HttpException: Please, see whether wrapping the code block, generating the exception, within RadCodeBlock resolves the error. ---> System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). at System.Web.UI.ControlCollection.AddAt(Int32 index, Control child) at Telerik.Web.UI.RadAjaxControl.MoveUpdatePanel(Control initiator, Control updated) --- End of inner exception stack trace --- at Telerik.Web.UI.RadAjaxControl.MoveUpdatePanel(Control initiator, Control updated) at Telerik.Web.UI.RadAjaxControl.PerformRender() at Telerik.Web.UI.RadAjaxControl.OnPageRender(HtmlTextWriter writer, Control page) at Telerik.Web.UI.RadAjaxControl.RenderPageInAjaxMode(HtmlTextWriter writer, Control page) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at DotNetNuke.Framework.PageBase.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace ---

     

    Please suggest is any alternative way to do this ……

    Thank you once again to all

  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 24 Oct 2012 Link to this post

    Hello Rohan,

    Using RadAjaxPanel should automatically keep the scroll position as you need. As for the error you are facing I would suggest you to review the help topic below which elaborates on its fixing:
    http://www.telerik.com/help/aspnet-ajax/ajax-radscriptblock-radcodeblock.html

    All the best,
    Maria Ilieva
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. Peter
    Peter avatar
    40 posts
    Member since:
    Mar 2012

    Posted 14 Jan 2013 Link to this post

    What is the issue here? Our "EditFormSettings" User Control in the Grid won't render the JavaScript?
  4. Allen
    Allen avatar
    111 posts
    Member since:
    Apr 2012

    Posted 19 Sep 2013 Link to this post

    I'm having the same issue.  For simplication, I put the RadAjaxManager in the aspx page instead of masterpage, I still get the same error: Please, see whether wrapping the code block, generating the exception, within RadCodeBlock resolves the error.
    Here is my script and I even put the scripts in the RadScriptBlock / RadCodeBlock :

    <%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="CDEDistricts.aspx.vb" Inherits="CDEDistricts" title="Custom Drivers by Distrcit" EnableEventValidation="false" %>
    <%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

    <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
        <style type="text/css">
            .style1
            {
                width: 292px;
            }
            p.MsoNormal
     {margin-bottom:.0001pt;
     font-size:12.0pt;
     font-family:"Times New Roman","serif";
             margin-left: 0in;
                margin-right: 0in;
                margin-top: 0in;
            }
            </style>
           

    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="MainContentPlaceHolder" Runat="Server">
        <%--<asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>--%>
        <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
                    <Scripts>
                        <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                        <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                        <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
                    </Scripts>
                </telerik:RadScriptManager>
            <asp:Panel ID="pnlRegion" runat="server">
               
                <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="gvCustomDriver">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="gvCustomDriver" UpdatePanelCss
                            LoadingPanelID="RadAjaxLoadingPanel2" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
    <script type="text/javascript">
        function EnableEditing(a) {
            for (var i = 0; i < document.forms[0].elements.length; i++) {
                var element = document.forms[0].elements[i];
                switch (element.type) {
                    case 'text':
                        if (a) {
                            document.forms[0].elements[i].readOnly = false;
                        }
                        else {
                            document.forms[0].elements[i].readOnly = true;
                            document.forms[0].elements[i].style.background = '#eeeeee';
                        }
                        break;
                }
            }
        }
        function hourglass() {
            document.body.style.cursor = "wait";
        }
        function preventBackspace(e) {
            var evt = e || window.event;
            if (evt) {
                var keyCode = evt.charCode || evt.keyCode;
                if (keyCode === 8) {
                    if (evt.preventDefault) {
                        evt.preventDefault();
                    } else {
                        //Check if the text box is read only and then disable the backspace functionality
                        if (document.getElementById("ctl00_MainContentPlaceHolder_gvCustomDriver_ctl02_lblSunHrs").getAttribute("readonly")) {
                            evt.returnValue = false;
                        }
                    }
                }
            }
        }
    </script>
    </telerik:RadScriptBlock>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel2" runat="server" Height="75px"
     
            Width="75px" Transparency="0">
     
            <%--<img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' style="border: 0;" />
            --%>       
            <img alt="Loading..." src=  "Images/pleasewait.gif" style="border: 0;"/>
     
        </telerik:RadAjaxLoadingPanel>            
        <h2 class="GridHeading">Custom Driver Entry
            Form:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<table>
                <%-- jsy - todo - Do Not show the Regions drop down to these groups. --%>
                <%' If Not Session.Item("IsWFMCATDistrictAdmin") = True Then%>
                <tr>
                    <td align="left" colspan="3">
                        <p>
                            <span>Please select the desired division, region and district to enter custom
                            driver information for all locations in that district.&nbsp; You can edit and save
                            the week that is 4 weeks out or more as of Friday 10:00pm.&nbsp; If there are no
                            values for a driver then the previous week&#39;s values are displayed. Please make
                            sure you select the Save and Export button to save the data.</span><p>
                            </p>
                            <p>
                            </p>
                            <h2 class="RowLabel">
                                &nbsp;</h2>
                            <p>
                            </p>
                            <p>
                            </p>
                            <p>
                            </p>
                            <p>
                            </p>
                            <p>
                            </p>
                            <p>
                            </p>
                            <p>
                            </p>
                            <p>
                            </p>
                            <p>
                            </p>
                            <p>
                            </p>
                            <p>
                            </p>
                            <p>
                            </p>
                            <p>
                            </p>
                            <p>
                            </p>
                            <p>
                            </p>
                            <p>
                            </p>
                            <p>
                            </p>
                            <p>
                            </p>
                            <p>
                            </p>
                            <p>
                            </p>
                        </p>
                    </td>
                </tr>
                <tr>
                    <td colspan="3">
                        &nbsp;
                    </td>
                   
                    <td>
                        <asp:CheckBox ID="btnAllWeels" runat="server" Checked="True"
                            Text="copy to all weeks"
                            Font-Italic="True" Font-Size="X-Small" />
                        &nbsp;</td>   
                </tr>
                <tr>
                    <td class="RowLabel" style="width:100px;">
                        Division:</td>
                    <td width="10px">
                        </td>
                    <td align="left" class="style1">
                        <asp:DropDownList ID="ddlDivision" runat="server" AutoPostBack="true"
                            Height="31px" Width="293px">
                            <asp:ListItem Selected="True" Value="71">Macys</asp:ListItem>
                            <asp:ListItem Value="72">Bloomingdales</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td>
                        <asp:ImageButton ID="btnSave" runat="server" ImageAlign="Middle"
                            ImageUrl="Images/Save_and_Export.jpg" />
                    </td>
                </tr>
                <tr>
                    <td class="RowLabel" style="width:100px;">
                        Region:</td>
                    <td width="10px">
                        &nbsp;</td>
                    <td align="left" class="style1">
                        <asp:DropDownList ID="ddlRegions" runat="server" AutoPostBack="true"
                            Height="31px" Width="293px">
                        </asp:DropDownList>
                        <cc1:CascadingDropDown ID="ddlRegions_CascadingDropDown" runat="server"
                            Category="orglev3" Enabled="True" PromptText="Please select a Region"
                            ServiceMethod="GetRegions" ServicePath="MacysOrgLevels.asmx"
                            TargetControlID="ddlRegions" UseContextKey="True">
                        </cc1:CascadingDropDown>
                    </td>
                   
                    <td>
                        <asp:ImageButton ID="btnScreenPrintDist1" runat="server" ImageAlign="Middle"
                            ImageUrl="~/Images/screen_print.jpg" onclientclick="window.print()"
                            Enabled="False" ToolTip="save records before you print" />
                    </td>
                </tr>
                <tr>
                    <td class="RowLabel" style="width:100px;">
                        District:</td>
                    <td width="10px">
                        &nbsp;</td>
                    <td align="left" class="style1">
                        <asp:DropDownList ID="ddlDistricts" runat="server" AutoPostBack="true"
                            Height="31px" Width="293px">
                        </asp:DropDownList>
                        <cc1:CascadingDropDown ID="ddlDistricts_CascadingDropDown" runat="server"
                            Category="orglev4" Enabled="True"
                            LoadingText="Please wait while the list is being loaded."
                            ParentControlID="ddlRegions" PromptText="Please select a District"
                            ServiceMethod="GetDistricts" ServicePath="MacysOrgLevels.asmx"
                            TargetControlID="ddlDistricts" UseContextKey="True">
                        </cc1:CascadingDropDown>
                    </td>
                </tr>
                <tr ID="trAMC" runat="server" visible="false">
                    <td class="RowLabel" style="width:100px;">
                        AMC Week:</td>
                    <td width="10px">
                        &nbsp;</td>
                    <td class="RowLabel">
                        <asp:DropDownList ID="ddlAMCWeek" runat="server" AutoPostBack="true"
                            EnableViewState="true" Height="31px" Width="50px">
                        </asp:DropDownList>
                        &nbsp;&nbsp;Week Begin Date:&nbsp;&nbsp;<asp:Label ID="lblAMCWeek" runat="server"></asp:Label>
                        <asp:LinkButton ID="lnkExcel" runat="server" CssClass="RowLabel" Text="Export"
                            ToolTip="Export the Custom driver data to Excel" visible="false"></asp:LinkButton>
                        &nbsp;&nbsp;<asp:CheckBox ID="chkHideZeroes" runat="server" visible= "true" AutoPostBack="True" Text="HideZeroes"                  
                            ToolTip="Check or uncheck this box to hide or show the custom driver values which are all zeroes for the whole week." Checked="True" />
                        &nbsp;&nbsp; Page Size: &nbsp;   
                        <asp:DropDownList ID="ddlPageSize" runat="server" AutoPostBack="True"
                            EnableViewState="true" Height="31px" Width="50px">
                            <asp:ListItem>10</asp:ListItem>
                            <asp:ListItem>20</asp:ListItem>
                            <asp:ListItem Selected="True">50</asp:ListItem>
                            <asp:ListItem>100</asp:ListItem>
                            <asp:ListItem>1000</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td align="left" colspan="3">
                        <asp:Label ID="lblMessage" runat="server" CssClass="RowLabel" ForeColor="Red"
                            Visible="false"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td align="left" colspan="3">
                        <asp:Label ID="lblMessageWeek" runat="server" CssClass="RowLabel"
                            ForeColor="#cc0000" Visible="false"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td colspan="3">
                        <asp:ValidationSummary ID="ValidationSummary1" runat="server"
                            DisplayMode="BulletList" EnableClientScript="true"
                            HeaderText="You must enter correct value in the following fields:"
                            ShowMessageBox="true" />
                    </td>
                </tr>
            </table>
                </h2>
                <asp:GridView ID="gvCustomDriver" runat="server" AutoGenerateColumns="False"
                    DataKeyNames="DEPARTMENT,CUSTOMDRIVER,SUNHRS,MONHRS,TUESHRS,WEDHRS,THURSHRS,FRIHRS,SATHRS,DeptTotal,PrimKey"
                    HeaderStyle-HorizontalAlign="Center" HeaderStyle-VerticalAlign="Middle"
                    RowStyle-VerticalAlign="Bottom" ShowFooter="True" PageSize="50"
                    AllowPaging="True"  AllowSorting = "true" >
                    <RowStyle VerticalAlign="Bottom" />
                    <Columns>
                    <asp:TemplateField HeaderStyle-CssClass="header"
                            HeaderStyle-HorizontalAlign="center" HeaderText="Store"
                            SortExpression="STORE">
                            <EditItemTemplate>
                                <asp:Label ID="txtStore" runat="server" Text='<%# Bind("STORE") %>'></asp:Label>
                            </EditItemTemplate>
                            <FooterTemplate>
                                <asp:TextBox ID="txtNewStoreNum" runat="server" MaxLength="4"
                                    Text='<%# Bind("STORE") %>' visible="false"></asp:TextBox>
                            </FooterTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblStoreNum" runat="server" Text='<%# Bind("STORE") %>'></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle CssClass="header" HorizontalAlign="Center" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderStyle-CssClass="header"
                            HeaderStyle-HorizontalAlign="center" HeaderText="Dept."
                            SortExpression="DEPARTMENT">
                            <EditItemTemplate>
                                <asp:Label ID="txtDeptNum" runat="server" Text='<%# Bind("DEPARTMENT") %>'></asp:Label>
                            </EditItemTemplate>
                            <FooterTemplate>
                                <asp:TextBox ID="txtNewDeptNum" runat="server" MaxLength="4"
                                    Text='<%# Bind("DEPARTMENT") %>' visible="false"></asp:TextBox>
                            </FooterTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblDeptNum" runat="server" Text='<%# Bind("DEPARTMENT") %>'></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle CssClass="header" HorizontalAlign="Center" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderStyle-CssClass="header"
                            HeaderStyle-HorizontalAlign="center" HeaderText="Driver Name"
                            SortExpression="CUSTOMDRIVER">
                            <EditItemTemplate>
                                <asp:Label ID="txtDriverName" runat="server" Text='<%# Bind("CUSTOMDRIVER") %>'></asp:Label>
                            </EditItemTemplate>
                            <FooterTemplate>
                                <asp:TextBox ID="txtNewDriverName" runat="server"
                                    Text='<%# Bind("CUSTOMDRIVER") %>' visible="false"></asp:TextBox>
                            </FooterTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblCustomDriver" runat="server"
                                    Text='<%# Bind("CUSTOMDRIVER") %>'></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle CssClass="header" HorizontalAlign="Center" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderStyle-CssClass="header"
                            HeaderStyle-HorizontalAlign="Left" HeaderStyle-VerticalAlign="Middle"
                            HeaderText="SUN" SortExpression="SUNHRS">
                            <EditItemTemplate>
                                <asp:TextBox ID="txtSunHrs" runat="server" MaxLength="2"
                                    Text='<%# Bind("SUNHRS") %>' Width="19"></asp:TextBox>
                            </EditItemTemplate>
                            <FooterTemplate>
                                <asp:TextBox ID="ddlSunHrs" runat="server" visible="false">
                                </asp:TextBox>
                            </FooterTemplate>
                            <ItemTemplate>
                                <asp:TextBox ID="lblSunHrs" runat="server" Columns="3" MaxLength="7"
                                    onKeyDown="preventBackspace();" Text='<%# Bind("SUNHRS") %>'></asp:TextBox>
                                <asp:RangeValidator ID="CompareValidator1" runat="server"
                                    ControlToValidate="lblSunHrs" Display="Dynamic" EnableClientScript="true"
                                    ErrorMessage="The Sunday hours must be between 0 to 9999.99"
                                    MaximumValue="9999.99" MinimumValue="0" Type="Double" ValueToCompare="9999.99">*</asp:RangeValidator>
                                <asp:RequiredFieldValidator ID="RangeValidator1" runat="server"
                                    ControlToValidate="lblSunHrs" Display="Dynamic" EnableClientScript="true"
                                    ErrorMessage="The Sunday hours must be between 0 to 9999.99">*</asp:RequiredFieldValidator>
                            </ItemTemplate>
                            <HeaderStyle CssClass="header" HorizontalAlign="Left" VerticalAlign="Middle" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderStyle-CssClass="header"
                            HeaderStyle-HorizontalAlign="center" HeaderText="MON" SortExpression="MONHRS">
                            <EditItemTemplate>
                                <asp:TextBox ID="txtMonHrs" runat="server" MaxLength="2"
                                    Text='<%# Bind("MONHRS") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <FooterTemplate>
                                <asp:TextBox ID="ddlMonHrs" runat="server" visible="false">
                                </asp:TextBox>
                            </FooterTemplate>
                            <ItemTemplate>
                                <asp:TextBox ID="lblMonHrs" runat="server" Columns="3" MaxLength="7"
                                    onKeyDown="preventBackspace();" Text='<%# Bind("MONHRS") %>'></asp:TextBox>
                                <asp:RangeValidator ID="CompareValidator2" runat="server"
                                    ControlToValidate="lblMonHrs" Display="Dynamic" EnableClientScript="true"
                                    ErrorMessage="The Monday hours must be between 0 to 9999.99"
                                    MaximumValue="9999.99" MinimumValue="0" Type="Double" ValueToCompare="9999.99">*</asp:RangeValidator>
                                <asp:RequiredFieldValidator ID="RangeValidator22" runat="server"
                                    ControlToValidate="lblMonHrs" Display="Dynamic" EnableClientScript="true"
                                    ErrorMessage="The Monday hours must be between 0 to 9999.99"
                                    ValueToCompare="9999.99">*</asp:RequiredFieldValidator>
                            </ItemTemplate>
                            <HeaderStyle CssClass="header" HorizontalAlign="Center" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderStyle-CssClass="header"
                            HeaderStyle-HorizontalAlign="center" HeaderText="TUE" SortExpression="TUESHRS">
                            <EditItemTemplate>
                                <asp:TextBox ID="txtTuesHrs" runat="server" MaxLength="2"
                                    Text='<%# Bind("TUESHRS") %>' Width="19"></asp:TextBox>
                            </EditItemTemplate>
                            <FooterTemplate>
                                <asp:TextBox ID="ddlTuesHrs" runat="server" visible="false">
                                </asp:TextBox>
                            </FooterTemplate>
                            <ItemTemplate>
                                <asp:TextBox ID="lblTuesHrs" runat="server" Columns="3" MaxLength="7"
                                    onKeyDown="preventBackspace();" Text='<%# Bind("TUESHRS") %>'></asp:TextBox>
                                <asp:RangeValidator ID="CompareValidator3" runat="server"
                                    ControlToValidate="lblTuesHrs" Display="Dynamic" EnableClientScript="true"
                                    ErrorMessage="The Tuesday hours must be between 0 and 9999.99"
                                    MaximumValue="9999.99" MinimumValue="0" Type="Double" ValueToCompare="9999.99">*</asp:RangeValidator>
                                <asp:RequiredFieldValidator ID="RangeValidator2a" runat="server"
                                    ControlToValidate="lblTuesHrs" Display="Dynamic" EnableClientScript="true"
                                    ErrorMessage="The Tuesday hours must be between 0 and 9999.99"
                                    ValueToCompare="9999.99">*</asp:RequiredFieldValidator>
                            </ItemTemplate>
                            <HeaderStyle CssClass="header" HorizontalAlign="Center" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderStyle-CssClass="header"
                            HeaderStyle-HorizontalAlign="center" HeaderText="WED" SortExpression="WEDHRS">
                            <EditItemTemplate>
                                <asp:TextBox ID="txtWedHrs" runat="server" MaxLength="2"
                                    Text='<%# Bind("WEDHRS") %>' Width="19"></asp:TextBox>
                            </EditItemTemplate>
                            <FooterTemplate>
                                <asp:TextBox ID="ddlWedHrs" runat="server" visible="false">
                                </asp:TextBox>
                            </FooterTemplate>
                            <ItemTemplate>
                                <asp:TextBox ID="lblWedHrs" runat="server" Columns="3" MaxLength="7"
                                    onKeyDown="preventBackspace();" Text='<%# Bind("WEDHRS") %>'></asp:TextBox>
                                <asp:RangeValidator ID="CompareValidator4" runat="server"
                                    ControlToValidate="lblWedHrs" Display="Dynamic" EnableClientScript="true"
                                    ErrorMessage="The Wednesday hours must be between 0 and 9999.99"
                                    MaximumValue="9999.99" MinimumValue="0" Type="Double" ValueToCompare="9999.99">*</asp:RangeValidator>
                                <asp:RequiredFieldValidator ID="RangeValidator2b" runat="server"
                                    ControlToValidate="lblWedHrs" Display="Dynamic" EnableClientScript="true"
                                    ErrorMessage="The Wednesday hours must be between 0 and 9999.99">*</asp:RequiredFieldValidator>
                            </ItemTemplate>
                            <HeaderStyle CssClass="header" HorizontalAlign="Center" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderStyle-CssClass="header"
                            HeaderStyle-HorizontalAlign="center" HeaderText="THU" SortExpression="THURSHRS">
                            <EditItemTemplate>
                                <asp:TextBox ID="txtThursHrs" runat="server" MaxLength="7"
                                    Text='<%# Bind("THURSHRS") %>' Width="19"></asp:TextBox>
                            </EditItemTemplate>
                            <FooterTemplate>
                                <asp:TextBox ID="ddlThursHrs" runat="server" visible="false">
                                </asp:TextBox>
                            </FooterTemplate>
                            <ItemTemplate>
                                <asp:TextBox ID="lblThursHrs" runat="server" Columns="3" MaxLength="7"
                                    onKeyDown="preventBackspace();" Text='<%# Bind("THURSHRS") %>'></asp:TextBox>
                                <asp:RangeValidator ID="CompareValidator5" runat="server"
                                    ControlToValidate="lblThursHrs" Display="Dynamic" EnableClientScript="true"
                                    ErrorMessage="The Thursday hours must be between 0 and 9999.99"
                                    MaximumValue="9999.99" MinimumValue="0" Type="Double" ValueToCompare="9999.99">*</asp:RangeValidator>
                                <asp:RequiredFieldValidator ID="RangeValidator2c" runat="server"
                                    ControlToValidate="lblThursHrs" Display="Dynamic" EnableClientScript="true"
                                    ErrorMessage="The Thursday hours must be between 0 and 9999.99">*</asp:RequiredFieldValidator>
                            </ItemTemplate>
                            <HeaderStyle CssClass="header" HorizontalAlign="Center" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderStyle-CssClass="header"
                            HeaderStyle-HorizontalAlign="center" HeaderText="FRI" SortExpression="FRIHRS">
                            <EditItemTemplate>
                                <asp:TextBox ID="txtFriHrs" runat="server" MaxLength="2"
                                    Text='<%# Bind("FRIHRS") %>' Width="19"></asp:TextBox>
                            </EditItemTemplate>
                            <FooterTemplate>
                                <asp:TextBox ID="ddlFriHrs" runat="server" visible="false">
                                </asp:TextBox>
                            </FooterTemplate>
                            <ItemTemplate>
                                <asp:TextBox ID="lblFriHrs" runat="server" Columns="3" MaxLength="7"
                                    onKeyDown="preventBackspace();" Text='<%# Bind("FRIHRS") %>'></asp:TextBox>
                                <asp:RangeValidator ID="CompareValidator6" runat="server"
                                    ControlToValidate="lblFriHrs" Display="Dynamic" EnableClientScript="true"
                                    ErrorMessage="The Friday hours must be between 0 and 9999.99"
                                    MaximumValue="9999.99" MinimumValue="0" Type="Double" ValueToCompare="9999.99">*</asp:RangeValidator>
                                <asp:RequiredFieldValidator ID="RangeValidator2d" runat="server"
                                    ControlToValidate="lblFriHrs" Display="Dynamic" EnableClientScript="true"
                                    ErrorMessage="The Friday hours must be between 0 and 9999.99">*</asp:RequiredFieldValidator>
                            </ItemTemplate>
                            <HeaderStyle CssClass="header" HorizontalAlign="Center" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderStyle-CssClass="header"
                            HeaderStyle-HorizontalAlign="center" HeaderText="SAT" SortExpression="SATHRS">
                            <EditItemTemplate>
                                <asp:TextBox ID="txtSatHrs" runat="server" MaxLength="2"
                                    Text='<%# Bind("SATHRS") %>' Width="19"></asp:TextBox>
                            </EditItemTemplate>
                            <FooterTemplate>
                                <asp:TextBox ID="ddlSatHrs" runat="server" visible="false"
                                    Font-Bold="True" Font-Italic="True" ForeColor="Red">
                                </asp:TextBox>
                            </FooterTemplate>
                            <ItemTemplate>
                                <asp:TextBox ID="lblSatHrs" runat="server" Columns="3" MaxLength="7"
                                    onKeyDown="preventBackspace();" Text='<%# Bind("SATHRS") %>'></asp:TextBox>
                                <asp:RangeValidator ID="CompareValidator7" runat="server"
                                    ControlToValidate="lblSatHrs" Display="Dynamic" EnableClientScript="true"
                                    ErrorMessage="The Saturday hours must be between 0 and 9999.99"
                                    MaximumValue="9999.99" MinimumValue="0" Type="Double" ValueToCompare="9999.99">*</asp:RangeValidator>
                                <asp:RequiredFieldValidator ID="RangeValidator2e" runat="server"
                                    ControlToValidate="lblSatHrs" Display="Dynamic" EnableClientScript="true"
                                    ErrorMessage="The Saturday hours must be between 0 and 9999.99">*</asp:RequiredFieldValidator>
                            </ItemTemplate>
                            <HeaderStyle CssClass="header" HorizontalAlign="Center" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderStyle-CssClass="header" HeaderText="Edit"
                            Visible="false">
                            <EditItemTemplate>
                                <asp:ImageButton ID="btnUpdate" runat="server" AlternateText="Update"
                                    CausesValidation="True" CommandName="Update" ImageUrl="Images/accept.png"
                                    ToolTip="Update" />
                                <asp:ImageButton ID="btnCancel" runat="server" AlternateText="Cancel"
                                    CausesValidation="False" CommandName="Cancel" ImageUrl="Images/cancel.png"
                                    ToolTip="Cancel" />
                            </EditItemTemplate>
                            <FooterTemplate>
                                <asp:LinkButton ID="lnkAdd" runat="server" CommandName="AddNew" Visible="false">Add New</asp:LinkButton>
                            </FooterTemplate>
                            <ItemTemplate>
                                <asp:ImageButton ID="btnEdit" runat="server" AlternateText="Edit"
                                    CausesValidation="False" CommandName="Edit" ImageUrl="Images/pencil.png"
                                    ToolTip="Edit" />
                            </ItemTemplate>
                            <HeaderStyle CssClass="header" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Total Hours" SortExpression="DeptTotal">
                            <EditItemTemplate>
                                <asp:TextBox ID="txtDeptTotal" runat="server" MaxLength="2"
                                    Text='<%# Bind("DeptTotal") %>' Width="19px" Font-Bold="True"
                                    Font-Italic="True" ForeColor="#EC0000" Enabled="False"></asp:TextBox>
                            </EditItemTemplate>
                            <FooterTemplate>
                                <asp:TextBox ID="ddlDeptTotal" runat="server" BackColor="White"
                                    Font-Bold="True" Font-Italic="True" ForeColor="#D90000" Enabled="False" >
                                </asp:TextBox>
                            </FooterTemplate>
                            <ItemTemplate>
                                <asp:TextBox ID="lblDeptTotal" runat="server" Columns="3" ForeColor="Red"
                                    MaxLength="7" onKeyDown="preventBackspace();" ReadOnly="True"
                                    Text='<%# Bind("DeptTotal") %>' Enabled="False"></asp:TextBox>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Primary Key" SortExpression="PrimKey" Visible="false">
                            <EditItemTemplate>
                                <asp:TextBox ID="PrimKey" runat="server" MaxLength="2"
                                    Text='<%# Bind("PrimKey") %>' Width="19px" Font-Bold="True"
                                    Font-Italic="True" ForeColor="#EC0000" Enabled="False"></asp:TextBox>
                            </EditItemTemplate>
                            <FooterTemplate>
                                <asp:TextBox ID="ddlPrimKey" runat="server" BackColor="White"
                                    Font-Bold="True" Font-Italic="True" ForeColor="#D90000" Enabled="False" >
                                </asp:TextBox>
                            </FooterTemplate>
                            <ItemTemplate>
                                <asp:TextBox ID="lblPrimKey" runat="server" Columns="3" ForeColor="Red"
                                    MaxLength="7" onKeyDown="preventBackspace();" ReadOnly="True"
                                    Text='<%# Bind("PrimKey") %>' Enabled="False"></asp:TextBox>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                </asp:GridView>
                <%--add both save and print buttons at the end of the page--%>
                <asp:ImageButton ID="btnSave0" runat="server" ImageAlign="Bottom"
                    ImageUrl="Images/Save_and_Export.jpg" Visible="False" />
                <asp:ImageButton ID="btnScreenPrintDist2" runat="server" ImageAlign="Bottom"
                    ImageUrl="~/Images/screen_print.jpg" onclientclick="window.print()"
                    Visible="False" />
               
        <br />
       
      <asp:Panel ID="pnlButtons" runat="server" Visible="false">
        <table>
           
            <tr id="trButtons" runat="server">
            <td>
            &nbsp;&nbsp;<asp:ImageButton ImageUrl="Images/Back.jpg" ID="btnBack" Text="Back" runat ="server"/>
            </td>
              </tr>
             </table>
           </asp:Panel>



           </asp:Panel>
              <asp:Panel ID="NoAccessPanel" runat="server" Visible="false">
            <table>
                <tr>
                    <td align="center"> <h1 style="color:Red"> No Access </h1> </td>
                </tr>
                <tr>
                    <td> &nbsp;</td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblNoAccess" runat="server" Font-Size="Large"></asp:Label>
                        &nbsp;</td>
               </tr>
                <tr>
                    <td> &nbsp;</td>
                </tr>

               <tr>
                    <td align="center">
                        <asp:ImageButton ID="btnReturnToHome" runat="server"
                            ImageUrl="~/Images/Home_Return.jpg"
                            PostBackUrl="~/Introduction.aspx" />
                    </td>
                </tr>
            </table>
       
        </asp:Panel>
       
    </asp:Content>


  5. Diego León
    Diego León avatar
    8 posts
    Member since:
    Dec 2011

    Posted 27 Mar 2014 Link to this post

    Hi Telerik Team

    any solution for this problem ??

    I have the some problem with a user control

    I use Page.LoadControl('my control') but not load the javascript functions.
  6. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 31 Mar 2014 Link to this post

    Hi Diego and Allen

    As this thread become rather big and different issues are discussed in it, I would suggest you to open separate support tickets and send us detailed description of the exact issues you are facing.
    Thus we will be able to handle them with the required attention needed for your specific cases.

    Regards,
    Maria Ilieva
    Telerik
     

    Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

     
Back to Top