This is a migrated thread and some comments may be shown as answers.

Microsoft JScript runtime error: Sys.InvalidOperationException: Could not find UpdatePanel with ID 'CPH_uscMsgBox1_udpMsj'. If it is being updated dynamically then it must be inside another UpdatePane

2 Answers 167 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Salman
Top achievements
Rank 1
Salman asked on 12 Mar 2011, 12:56 AM
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="FireQuench.MasterPage.Site" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<LINK REL=StyleSheet HREF="../App_Themes/Style/Style.css" TYPE="text/css"  >
<LINK REL=StyleSheet HREF=" TYPE="text/css"  >
<head runat="server">
    <title></title>
    <asp:ContentPlaceHolder ID="dddd" runat="server">
    </asp:ContentPlaceHolder>
  
        <link href="../App_Themes/Style/templatemo_style.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" media="all" href="../App_Themes/Style/aqua/theme.css" title="blue" />
    <link rel="alternate stylesheet" type="text/css" media="all" href="../App_Themes/Style/calendar-blue.css"
        title="winter" />
  
  
    <script type="text/javascript" src="../UserControl/jalali.js"></script>
  
    <!-- import the calendar script -->
  
    <script type="text/javascript" src="../UserControl/calendar.js"></script>
  
    <!-- import the calendar script -->
  
    <script type="text/javascript" src="../UserControl/calendar-setup.js"></script>
  
    <!-- import the language module -->
       <script type="text/javascript" src="../UserControl/calendar-fa.js"></script>
  
       <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
  
        var oldLink = null;
        // code to change the active stylesheet
        function setActiveStyleSheet(link, title) {
            var i, a, main;
            for (i = 0; (a = document.getElementsByTagName("link")[i]); i++) {
                if (a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
                    a.disabled = true;
                    if (a.getAttribute("title") == title) a.disabled = false;
                }
            }
            if (oldLink) oldLink.style.fontWeight = 'normal';
            oldLink = link;
            link.style.fontWeight = 'bold';
            return false;
        }
  
        /*  function today(){
        var currentDate=new Date();
              
        currentDate.setJalaliDate(currentDate.getDate());
        document.getElementById("date_input_1").value=currentDate.getJalaliDate();
        }*/
  
        function mask(str, textbox, loc, delim) {
            var locs = loc.split(',');
  
            for (var i = 0; i <= locs.length; i++) {
                for (var k = 0; k <= str.length; k++) {
                    if (k == locs[i]) {
                        if (str.substring(k, k + 1) != delim) {
                            str = str.substring(0, k) + delim + str.substring(k, str.length)
                        }
                    }
                }
            }
            textbox.value = str
        }
          
    </script>
    </telerik:RadCodeBlock>
</head>
  
<body   >
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    
  <table width="100%" >
    
  <tr>
  <td class="tdcel">
  هدر
  </td>
  <td>
  </td>
  </tr>
  <tr>
  <td class="tdcel">نام کاربر</td>
   <td>
  </td>
  </tr>
<tr>
<td class="tdcel" style="width:80%;">
<asp:ContentPlaceHolder ID="CPH" runat="server">
    </asp:ContentPlaceHolder>
  
</td>
<td class="tdcel" >
<telerik:RadPanelBar ID="RadPanelBar1" Height="100%" CssClass="PnlRight" 
        runat="server" PersistStateInCookie="True" 
        Skin="Outlook" EnableTheming="False" ExpandMode="SingleExpandedItem" 
       >
        <Items>
            <telerik:RadPanelItem runat="server" CssClass="Menuheader" Font-Bold="true" Font-Names="tahoma" Text="اطلاعات پایه" 
                >
                <Items>
                    <telerik:RadPanelItem runat="server" CssClass="MenuItem" Font-Names="tahoma" Text="شهرستان ها" 
                        NavigateUrl="~/PL/Parish.aspx">
                    </telerik:RadPanelItem>
                    <telerik:RadPanelItem runat="server" CssClass="MenuItem" Font-Names="tahoma"  
                        Text="بخش ها" NavigateUrl="~/PL/Part.aspx">
                    </telerik:RadPanelItem>
                    <telerik:RadPanelItem runat="server" CssClass="MenuItem" Font-Names="tahoma" 
                        Text="نوع کپسول ها" NavigateUrl="~/PL/CapsuleType.aspx">
                    </telerik:RadPanelItem>
                    <telerik:RadPanelItem runat="server" CssClass="MenuItem" Font-Names="tahoma" 
                        Text="وزن کپسول ها" NavigateUrl="~/PL/CapsuleWeight.aspx">
                    </telerik:RadPanelItem>
                    <telerik:RadPanelItem runat="server" CssClass="MenuItem" Font-Names="tahoma" 
                        Text="وضعیت دستگاه های خاموش کننده" NavigateUrl="~/PL/Status.aspx">
                    </telerik:RadPanelItem>
                </Items>
            </telerik:RadPanelItem>
            <telerik:RadPanelItem runat="server" CssClass="Menuheader" Font-Bold="true" 
                Font-Names="tahoma" Text="دستگاه های اطفاء حریق" Value="0">
                <Items>
                    <telerik:RadPanelItem runat="server" CssClass="MenuItem" Font-Names="tahoma" 
                        Text="کپسول ها" NavigateUrl="~/PL/Capsule.aspx" Value="1">
                    </telerik:RadPanelItem>
                    <telerik:RadPanelItem runat="server" CssClass="MenuItem" Font-Names="tahoma" 
                        Text="جعبه های F" NavigateUrl="~/PL/OtherSil.aspx" Value="2">
                    </telerik:RadPanelItem>
                    <telerik:RadPanelItem runat="server" CssClass="MenuItem" Font-Names="tahoma" 
                        Text="خاموش کننده های سقفی" Value="3">
                    </telerik:RadPanelItem>
                </Items>
            </telerik:RadPanelItem>
            <telerik:RadPanelItem runat="server" CssClass="Menuheader" Font-Bold="true" 
                Font-Names="tahoma" Text="عملیات دستگاه ها" Expanded="True">
                <Items>
                    <telerik:RadPanelItem runat="server" CssClass="MenuItem" Font-Names="tahoma" Owner="" Text="تعیین دوره بازدید">
                    </telerik:RadPanelItem>
                    <telerik:RadPanelItem runat="server" CssClass="MenuItem" Font-Names="tahoma" 
                        Text="شارژ کپسول ها" NavigateUrl="~/PL/Abet.aspx">
                    </telerik:RadPanelItem>
                    <telerik:RadPanelItem runat="server" CssClass="MenuItem" Font-Names="tahoma" 
                        Owner="" Text="بازدید ها" NavigateUrl="~/PL/Visit.aspx">
                    </telerik:RadPanelItem>
                </Items>
            </telerik:RadPanelItem>
            <telerik:RadPanelItem runat="server" CssClass="Menuheader" Font-Bold="true" 
                Font-Names="tahoma" Text="گزارشات">
                 
                <Items>
                    <telerik:RadPanelItem runat="server" CssClass="MenuItem" Font-Names="tahoma" 
                        Owner="" Text="لیست دستگاه های اطفاء حریق">
                    </telerik:RadPanelItem>
                    <telerik:RadPanelItem runat="server" CssClass="MenuItem" Font-Names="tahoma" 
                        Owner="" Text="لیست بازدید ها">
                    </telerik:RadPanelItem>
                </Items>
            </telerik:RadPanelItem>
            <telerik:RadPanelItem runat="server" CssClass="Menuheader" Font-Bold="true" 
                Font-Names="tahoma" Text="امنیت">
                 <Items>
                    <telerik:RadPanelItem runat="server" CssClass="MenuItem" Font-Names="tahoma" 
                        Text="کاربران" NavigateUrl="~/PL/User.aspx">
                    </telerik:RadPanelItem>
                    <telerik:RadPanelItem runat="server" CssClass="MenuItem" Font-Names="tahoma" 
                        Owner="" Text="تعیین دسترسی داده ها" Value="6">
                    </telerik:RadPanelItem>
                    <telerik:RadPanelItem runat="server" CssClass="MenuItem" Font-Names="tahoma" 
                        Text="تعیین دسترسی آیتم ها " Value="7">
                    </telerik:RadPanelItem>
                </Items>
            </telerik:RadPanelItem>
        </Items>
        <ExpandAnimation Duration="0" Type="None" />
        <CollapseAnimation Duration="0" Type="None" />
    </telerik:RadPanelBar>
</td>
</tr>
  
<tr>
<td class="tdcel">فوتر</td>
 <td>
  </td>
</tr>
  </table>
  
    
    
  
  
    
    </form>
</body>
</html>
I have this erro
Microsoft JScript runtime error: Sys.InvalidOperationException: Could not find UpdatePanel with ID 'CPH_uscMsgBox1_udpMsj'. If it is being updated dynamically then it must be inside another UpdatePanel.
please helpt to me
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/Site.Master" AutoEventWireup="true"
    CodeBehind="Visit.aspx.cs" Inherits="FireQuench.PL.Visit" %>
  
<%@ Register Src="../UserControl/uscMsgBox.ascx" TagName="uscMsgBox" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="dddd" runat="server">
    <link rel="StyleSheet" href="../App_Themes/Style/Style.css" type="text/css">
    <style type="text/css">
        .RadComboBox_Hay .rcbInputCell .rcbInput, .RadComboBoxDropDown_Hay
        {
            font: 9pt Tahoma !important;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="CPH" runat="server">
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
  
            function RowDblClick(sender, eventArgs) {
  
                editedRow = eventArgs.get_itemIndexHierarchical();
                var grid = $find("<%= grdParish.ClientID %>");
                var masterTable = grid.get_masterTableView();
                masterTable.editItem(editedRow);
            }
   
        </script>
    </telerik:RadCodeBlock>
      
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="grdVisit">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="mvAll" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="cmdParish">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="cmdPart" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="cmdPart">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="cmdPart" />
                    <telerik:AjaxUpdatedControl ControlID="grdParish" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="grdParish">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="grdParish" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnSave">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="grdVisit" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="grdDetail">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="grdDetail" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <asp:MultiView ID="mvAll" runat="server">
        <asp:View ID="vwShow" runat="server">
            <table class="tbl">
                <tr class="tdcel">
                    <td>
                        <telerik:RadGrid ID="grdVisit" runat="server" GridLines="None" Skin="Outlook" OnNeedDataSource="grdVisit_NeedDataSource"
                            OnItemCommand="grdVisit_ItemCommand">
                            <MasterTableView AutoGenerateColumns="False" DataKeyNames="iNumber" CommandItemDisplay="Top"
                                Dir="RTL">
                                <EditFormSettings>
                                    <EditColumn UniqueName="EditCommandColumn1">
                                    </EditColumn>
                                </EditFormSettings>
                                <HeaderStyle VerticalAlign="Middle" HorizontalAlign="Center" Font-Names="tahoma"
                                    Font-Size="9pt" Font-Bold="true" />
                                <RowIndicatorColumn>
                                    <HeaderStyle Width="20px" />
                                </RowIndicatorColumn>
                                <ExpandCollapseColumn>
                                    <HeaderStyle Width="20px" />
                                </ExpandCollapseColumn>
                                <CommandItemSettings AddNewRecordText="بازدید جدید" ShowRefreshButton="False" />
                                <Columns>
                                    <telerik:GridBoundColumn DataField="strNameParish" HeaderText="شهرستان" SortExpression="strNameParish"
                                        UniqueName="strNameParish">
                                        <HeaderStyle Width="150px" />
                                        <ItemStyle Width="80px" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="strNamePart" HeaderText="بخش" SortExpression="strNamePart"
                                        UniqueName="strNamePart">
                                        <HeaderStyle Width="150px" />
                                        <ItemStyle Width="80px" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="strVisitDate" HeaderText="تاریخ بازدید" SortExpression="strVisitDate"
                                        UniqueName="strVisitDate">
                                        <HeaderStyle Width="150px" />
                                        <ItemStyle Width="80px" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="strComment" HeaderText="توضیحات" SortExpression="strComment"
                                        UniqueName="strComment">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="iNumber" DataType="System.Int32" ForceExtractValue="Always"
                                        HeaderText="iNumber" ReadOnly="True" SortExpression="iNumber" UniqueName="iNumber"
                                        Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="iPartNumber" DataType="System.Int32" ForceExtractValue="Always"
                                        HeaderText="iPartNumber" SortExpression="iPartNumber" UniqueName="iPartNumber"
                                        Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="iParishNumber" DataType="System.Int32" HeaderText="iParishNumber"
                                        SortExpression="iParishNumber" UniqueName="iParishNumber" Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridEditCommandColumn UpdateText="ویرایش" ButtonType="ImageButton" 
                                        CancelText="انصراف" EditText="ویرایش ">
                                        <HeaderStyle Width="50px" />
                                    </telerik:GridEditCommandColumn>
                                    <telerik:GridButtonColumn CommandName="Delete" Text="حذف" UniqueName="column" 
                                        ButtonType="ImageButton">
                                        <HeaderStyle Width="50px" />
                                    </telerik:GridButtonColumn>
                                </Columns>
                            </MasterTableView><ClientSettings>
                                <Selecting AllowRowSelect="true" />
                            </ClientSettings>
                        </telerik:RadGrid>
                    </td>
                </tr>
            </table>
        </asp:View>
         
      
        
      <asp:View ID="vwEditAndInsert" runat="server">
            <table class="tbl">
                <tr class="tdcel">
                    <td>
                        <table cellpadding="2px" cellspacing="5px">
                            <tr class="tdcel">
                                <td>
                                    شهرستان:
                                </td>
                                <td>
                                    <telerik:RadComboBox ID="cmdParish" runat="server" OnSelectedIndexChanged="cmdParish_SelectedIndexChanged"
                                        Skin="Hay" AutoPostBack="True">
                                    </telerik:RadComboBox>
                                </td>
                                <td>
                                    بخش:
                                </td>
                                <td>
                                    <telerik:RadComboBox ID="cmdPart" runat="server" Skin="Hay" AutoPostBack="True" OnSelectedIndexChanged="cmdPart_SelectedIndexChanged">
                                    </telerik:RadComboBox>
                                </td>
                                <td>
                                    تاریخ بازدید:
                                </td>
                                <td>
                                    <table>
                                        <tr>
                                            <td>
                                                <asp:TextBox ID="txtDateVisit" ClientIDMode="Static" CssClass="tah" runat="server"
                                                    Width="100px" Text='<%# Bind("strAbetDate") %>'>
                                           
                                                </asp:TextBox>
                                            </td>
                                            <td>
                                                <img id="date_btn_1" alt="" src="../App_Themes/Style/Images/cal.png" style="vertical-align: top;" />
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr class="tdcel">
                                <td colspan="6">
                                    <table class="tbl">
                                        <tr class="tdcel">
                                            <td>
                                                <table class="tbl">
                                                    <tr class="tdcel">
                                                        <td>
                                                            توضیحات:
                                                        </td>
                                                        <td>
                                                            <telerik:RadTextBox ID="txtCommentVisit" Skin="Hay" Width="620px" runat="server">
                                                            </telerik:RadTextBox>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td>
                        <telerik:RadGrid ID="grdParish" runat="server" AutoGenerateColumns="False" GridLines="None"
                            HorizontalAlign="Center" ShowStatusBar="True" OnNeedDataSource="grdParish_NeedDataSource"
                            Skin="Outlook" Width="100%" OnUpdateCommand="grdParish_UpdateCommand">
                            <AlternatingItemStyle Font-Bold="False" Font-Italic="False" Font-Names="tahoma" Font-Overline="False"
                                Font-Size="9pt" Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"
                                VerticalAlign="Middle" Wrap="True" />
                            <MasterTableView DataKeyNames="iNumber" Dir="RTL" EditFormSettings-ColumnNumber="3"
                                EditMode="InPlace" EnableColumnsViewState="true" NoMasterRecordsText=" در بخش انتخاب شده دستگاهی وجود ندارد">
                                <RowIndicatorColumn>
                                    <HeaderStyle Width="20px" />
                                </RowIndicatorColumn>
                                <ExpandCollapseColumn>
                                    <HeaderStyle Width="20px" />
                                </ExpandCollapseColumn>
                                <CommandItemSettings AddNewRecordText=" شارژ جدید کپسول " ShowRefreshButton="False" />
                                <Columns>
                                    <telerik:GridBoundColumn DataField="strNameSilencerApplianceType" HeaderText="نوع دستگاه"
                                        SortExpression="strNameSilencerApplianceType" UniqueName="strNameSilencerApplianceType"
                                        ReadOnly="True">
                                        <HeaderStyle Width="150px" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="iNumber" DataType="System.Int32" HeaderText="iNumber"
                                        ReadOnly="True" SortExpression="iNumber" UniqueName="iNumber" 
                                        Visible="False" ForceExtractValue="Always">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="strChattelsCode" HeaderText="کد اموال" SortExpression="strChattelsCode"
                                        UniqueName="strChattelsCode" ReadOnly="True">
                                        <HeaderStyle Width="150px" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="iPartNumber" DataType="System.Int32" HeaderText="iPartNumber"
                                        SortExpression="iPartNumber" UniqueName="iPartNumber" Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="iCapsuleTypeNumber" DataType="System.Int32" HeaderText="iCapsuleTypeNumber"
                                        SortExpression="iCapsuleTypeNumber" UniqueName="iCapsuleTypeNumber" Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="iCapsuleWeightNumber" DataType="System.Int32"
                                        HeaderText="iCapsuleWeightNumber" SortExpression="iCapsuleWeightNumber" UniqueName="iCapsuleWeightNumber"
                                        Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="iStatusNumber" DataType="System.Int32" HeaderText="iStatusNumber"
                                        SortExpression="iStatusNumber" UniqueName="iStatusNumber" Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="iTimeLife" DataType="System.Int32" HeaderText="iTimeLife"
                                        SortExpression="iTimeLife" UniqueName="iTimeLife" Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="tiSilencerApplianceTypeNumber" DataType="System.Byte"
                                        HeaderText="tiSilencerApplianceTypeNumber" SortExpression="tiSilencerApplianceTypeNumber"
                                        UniqueName="tiSilencerApplianceTypeNumber" Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="strProductionDate" HeaderText="strProductionDate"
                                        SortExpression="strProductionDate" UniqueName="strProductionDate" Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="strPhysicalPlace" HeaderText="محل استقرار" SortExpression="strPhysicalPlace"
                                        UniqueName="strPhysicalPlace" ReadOnly="True">
                                        <HeaderStyle Width="150px" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="iParishNumber" DataType="System.Int32" HeaderText="iParishNumber"
                                        SortExpression="iParishNumber" UniqueName="iParishNumber" Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="strNamePart" HeaderText="strNamePart" SortExpression="strNamePart"
                                        UniqueName="strNamePart" Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="strNameParish" HeaderText="strNameParish" SortExpression="strNameParish"
                                        UniqueName="strNameParish" Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="iPartNumber2" DataType="System.Int32" HeaderText="iPartNumber2"
                                        SortExpression="iPartNumber2" UniqueName="iPartNumber2" Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="strNameCapsulType" HeaderText="strNameCapsulType"
                                        SortExpression="strNameCapsulType" UniqueName="strNameCapsulType" Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="strNameCapsulWeight" DataType="System.Decimal"
                                        HeaderText="strNameCapsulWeight" SortExpression="strNameCapsulWeight" UniqueName="strNameCapsulWeight"
                                        Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="strNameStatus" HeaderText="وضعیت فعلی" SortExpression="strNameStatus"
                                        UniqueName="strNameStatus1" Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="strInfo" HeaderText="strInfo" ReadOnly="True"
                                        SortExpression="strInfo" UniqueName="strInfo" Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridTemplateColumn DataField="strNameStatus" ForceExtractValue="Always"
                                        HeaderText="وضعیت فعلی" SortExpression="strNameStatus" UniqueName="strNameStatus">
                                        <EditItemTemplate>
                                            <telerik:RadComboBox ID="strNameStatusComboBox" runat="server" Font-Names="tahoma"
                                                Font-Size="9pt" DataSourceID="SqlDataSource1" DataTextField="strName" DataValueField="iNumber"
                                                CssClass="rcbInputCell" SelectedValue='<%#Bind("iStatusNumber") %>'>
                                            </telerik:RadComboBox>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                          <asp:Label ID="strNameStatusLabel" runat="server" Text='<%# Eval("strNameStatus") %>'></asp:Label>
                                        </ItemTemplate>
                                        <HeaderStyle Width="150px" />
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn DataField="strTemp" HeaderText="توضیحات" 
                                        UniqueName="strComment" ForceExtractValue="Always">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="strNewCommentTextBox" Width="300px" runat="server" Text=""></asp:TextBox></EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="strNewCommentLabel" Text='<%# Eval("strTemp") %>' runat="server"></asp:Label></ItemTemplate>
                                        <ItemStyle Width="300px" />
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridEditCommandColumn CancelText="انصراف" UpdateText="ثبت موقت" EditText="ویرایش"
                                        HeaderButtonType="None" ButtonType="ImageButton">
                                        <HeaderStyle Width="60px" />
                                    </telerik:GridEditCommandColumn>
                                </Columns>
                                <EditFormSettings CaptionDataField="strChattelsCode" CaptionFormatString="در حال ویرایش  شارژ کپسول با کد اموال{0} ">
                                    <EditColumn ButtonType="ImageButton" CancelText="انصراف" InsertText="ذخیره" UniqueName="EditCommandColumn1"
                                        UpdateText="ذخیره">
                                    </EditColumn>
                                </EditFormSettings>
                                <ItemStyle Font-Bold="False" Font-Italic="False" Font-Names="tahoma" Font-Overline="False"
                                    Font-Size="9pt" Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"
                                    VerticalAlign="Middle" Wrap="True" />
                                <EditItemStyle BackColor="#CCCCFF" Font-Bold="False" Font-Italic="False" Font-Names="tahoma"
                                    Font-Overline="False" Font-Size="9pt" Font-Strikeout="False" Font-Underline="False"
                                    HorizontalAlign="Right" VerticalAlign="Middle" Wrap="True" />
                                <HeaderStyle Font-Bold="True" Font-Italic="False" Font-Names="tahoma" Font-Overline="False"
                                    Font-Size="9pt" Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"
                                    VerticalAlign="Middle" Wrap="True" />
                            </MasterTableView><ClientSettings>
                                <ClientEvents OnRowDblClick="RowDblClick" />
                                <Selecting AllowRowSelect="true" />
                            </ClientSettings>
                        </telerik:RadGrid>
                    </td>
                </tr>
                <tr>
                    <td>
                        <table cellpadding="10px" cellspacing="10px">
                            <tr>
                                <td>
                                     
              
  
                                        
  
  
  
  
                                    <uc1:uscMsgBox ID="uscMsgBox1" runat="server" />
                                     
              
  
                                        
  
  
  
  
                                    <asp:Button ID="btnSave" runat="server" CssClass="tdcel" Text="ذخیره" 
                                        onclick="btnSave_Click" />
                                </td>
                                <td>
                                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" EnableCaching="true" SqlCacheDependency="FireQuench:Status"
                                        CacheExpirationPolicy="Absolute" ConnectionString="<%$ ConnectionStrings:FireQuenchConnectionString %>"
                                        SelectCommand="SELECT * FROM [Status]"></asp:SqlDataSource>
                                    <asp:Button ID="btnCancel" runat="server" CssClass="tdcel" Text="انصراف" OnClick="btnCancel_Click" />
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </asp:View>
       
          
        <asp:View ID="vwEdit" runat="server">
            <table class="tbl">
                <tr class="tdcel">
                    <td>
                        <telerik:RadGrid ID="grdDetail" runat="server" GridLines="None" OnItemDataBound="grdDetail_ItemDataBound"
                            Skin="Outlook">
                            <MasterTableView AutoGenerateColumns="False" EditMode="InPlace">
                                <RowIndicatorColumn>
                                    <HeaderStyle Width="20px" />
                                </RowIndicatorColumn>
                                <ExpandCollapseColumn>
                                    <HeaderStyle Width="20px" />
                                </ExpandCollapseColumn>
                                <HeaderStyle Font-Bold="true" Font-Names="tahoma" Font-Size="9pt" HorizontalAlign="Center"
                                    VerticalAlign="Middle" />
                                <Columns>
                                    <telerik:GridBoundColumn DataField="strVisitDate" ForceExtractValue="Always" HeaderText="strVisitDate"
                                        SortExpression="strVisitDate" UniqueName="strVisitDate" Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="strCommentVisit" ForceExtractValue="Always" HeaderText="strCommentVisit"
                                        SortExpression="strCommentVisit" UniqueName="strCommentVisit" Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="strNamePart" ForceExtractValue="Always" HeaderText="strNamePart"
                                        SortExpression="strNamePart" UniqueName="strNamePart" Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="iParishNumber" DataType="System.Int32" ForceExtractValue="Always"
                                        HeaderText="iParishNumber" SortExpression="iParishNumber" UniqueName="iParishNumber"
                                        Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="strNameParish" ForceExtractValue="Always" HeaderText="strNameParish"
                                        SortExpression="strNameParish" UniqueName="strNameParish" Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="strNameSilencerApplianceType" ForceExtractValue="Always"
                                        HeaderText="نوع دستگاه" ReadOnly="True" SortExpression="strNameSilencerApplianceType"
                                        UniqueName="strNameSilencerApplianceType">
                                        <HeaderStyle Width="150px" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="iNumber" DataType="System.Int32" ForceExtractValue="Always"
                                        HeaderText="iNumber" SortExpression="iNumber" UniqueName="iNumber" Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="strChattelsCode" ForceExtractValue="Always" HeaderText="کد اموال"
                                        ReadOnly="True" SortExpression="strChattelsCode" UniqueName="strChattelsCode">
                                        <HeaderStyle Width="150px" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="iPartNumber" DataType="System.Int32" ForceExtractValue="Always"
                                        HeaderText="iPartNumber" SortExpression="iPartNumber" UniqueName="iPartNumber"
                                        Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="iCapsuleTypeNumber" DataType="System.Int32" ForceExtractValue="Always"
                                        HeaderText="iCapsuleTypeNumber" SortExpression="iCapsuleTypeNumber" UniqueName="iCapsuleTypeNumber"
                                        Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="iCapsuleWeight" DataType="System.Int32" ForceExtractValue="Always"
                                        HeaderText="iCapsuleWeight" SortExpression="iCapsuleWeight" UniqueName="iCapsuleWeight"
                                        Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="iStatusNumber" DataType="System.Int32" ForceExtractValue="Always"
                                        HeaderText="iStatusNumber" SortExpression="iStatusNumber" UniqueName="iStatusNumber"
                                        Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="iTimeLife" DataType="System.Int32" ForceExtractValue="Always"
                                        HeaderText="iTimeLife" SortExpression="iTimeLife" UniqueName="iTimeLife" Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="tiSilencerApplianceTypeNumber" DataType="System.Byte"
                                        ForceExtractValue="Always" HeaderText="tiSilencerApplianceTypeNumber" SortExpression="tiSilencerApplianceTypeNumber"
                                        UniqueName="tiSilencerApplianceTypeNumber" Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="strProductionDate" ForceExtractValue="Always"
                                        HeaderText="strProductionDate" SortExpression="strProductionDate" UniqueName="strProductionDate"
                                        Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="strPhysicalPlace" ForceExtractValue="Always"
                                        HeaderText="محل استقرار" ReadOnly="True" SortExpression="strPhysicalPlace" UniqueName="strPhysicalPlace">
                                        <HeaderStyle Width="150px" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridTemplateColumn DataField="strNameStatus" ForceExtractValue="Always"
                                        HeaderText="وضعیت فعلی" SortExpression="strNameStatus" UniqueName="strNameStatus">
                                        <EditItemTemplate>
                                            <telerik:RadComboBox ID="strNameStatusComboBox0" runat="server">
                                            </telerik:RadComboBox>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="strNameStatusLabel" runat="server" Text='<%# Eval("strNameStatus") %>'></asp:Label></ItemTemplate>
                                        <HeaderStyle Width="150px" />
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridBoundColumn DataField="strComment" ForceExtractValue="Always" HeaderText="توضیحات"
                                        SortExpression="strComment" UniqueName="strComment">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="iVisitNumber" DataType="System.Int32" ForceExtractValue="Always"
                                        HeaderText="iVisitNumber" SortExpression="iVisitNumber" UniqueName="iVisitNumber"
                                        Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridEditCommandColumn EditText="ویرایش" UpdateText="ذخیره">
                                    </telerik:GridEditCommandColumn>
                                </Columns>
                            </MasterTableView>
                            <ClientSettings>
                                <Selecting AllowRowSelect="true" />
                            </ClientSettings>
                        </telerik:RadGrid>
                    </td>
                </tr>
                <tr>
                    <td>
                        <table class="tbl">
                            <tr class="tdcel">
                                <td>
                                    
                                    <asp:Button ID="btnSaveEdit" runat="server" CssClass="tdcel" Text="ذخیره" />
                                </td>
                                <td>
                                    <asp:Button ID="btnCancelEdit" runat="server" CssClass="tdcel" Text="انصراف" />
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </asp:View>
    </asp:MultiView>
    <telerik:RadCodeBlock ID="RadCodeBlock2" runat="server">
        <script type="text/javascript">
            Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
  
            Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(pageLoadedHandler)
  
            function pageLoadedHandler(sender, args)
            { SetCalendarStartTime(); }
  
  
            function EndRequestHandler(sender, args)
            { SetCalendarStartTime(); }
  
            function SetCalendarStartTime() {
                Calendar.setup({
                    inputField: 'txtDateVisit',
  
                    button: "date_btn_1",
                    ifFormat: "%Y/%m/%d",
                    dateType: 'jalali',
  
                    weekNumbers: false
                });
            }
  
  
  
  
        </script>
    </telerik:RadCodeBlock>
</asp:Content>

and master page is here:


2 Answers, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 17 Mar 2011, 08:07 AM
Hello Salman,

The exception you are getting is often caused when an updated control or its parent container is not rendered. For example, if you have an AJAX setting in your RadAjaxManager specifying a panel controls (say Panel1) is updated by a button control (say Button1). The AJAX setting would look like:

<telerik:RadAjaxManager>
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="Button1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="Panel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>

In the above scenario, you can get this exception if a parent container control of Panel1 is not rendered (with Visible=false). RadAjaxManager creates UpdatePanel controls dynamically around each updated control in its AJAX settings. These update panels are registered with the ScriptManager on the page. If they are not rendered, the client-side AJAX framework is unable to find them by the specified ID. You get this error.

Veli
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Daniel
Top achievements
Rank 1
answered on 03 Oct 2012, 06:25 PM
i know it's an old post but I thought the following update would be helpful for anyone searching this in the future, wherever your conditional logic is to display / hide controls, dynamically add updated controls as needed to the ajaxmanager (codebehind)

e.g. this.RadAjaxManager1.AjaxSettings[0].UpdatedControls.Add(new AjaxUpdatedControl("ctrlid", "ldingPanelId"));
Tags
Ajax
Asked by
Salman
Top achievements
Rank 1
Answers by
Veli
Telerik team
Daniel
Top achievements
Rank 1
Share this question
or