无法注释ID为'AjaxPanel'的UpdatePanel,因为它未在ScriptManager中注册。如果这可能会发生

时间:2013-01-12 07:54:29

标签: c# telerik

请我存在这个错误,我无法摆脱它我在另一个用户控件内有一个用户控件,子控件包含RadAjaxPanel。

父控件包含一个Radgrid,希望有一个editformTemplate,并在其中加载子控件,我将在代码中显示:

<EditFormSettings EditFormType="Template">
                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                </EditColumn>
                <FormStyle BackColor="#FCFCFC"></FormStyle>
                <FormTemplate>
                       <table>
                            <tr>
                                <td class="LblWidth" style="padding-top: 5px;">
                             <asp:Label ID="Label1" runat="server" Text="Center logo:">
                                    </asp:Label>
                                </td>
                                <td style="padding-top: 10px;">

                 <uc1:MAYAUploadImageControl ID="UploadImageControl1" runat="server" />


                                    <span class="redSpan">
                                    </span>
                                </td>
                            </tr>
                        </table>
   </FormTemplate>
            </EditFormSettings>

这是父控件

儿童控制是:

<telerik:RadAjaxPanel ID="ajaxPanel" runat="server" >
    <asp:HiddenField ID="hf_FileName" runat="server" />
    <asp:HiddenField ID="ImageChanged" runat="server" Value="0" />
    <asp:Label ID="Label1" runat="server" Text="New Picture:"></asp:Label>
    <br />
    <telerik:RadImageEditor ID="RIEditor" runat="server" Width="180" Height="150" ToolBarMode="Default"
        EnableResize="false" EnableTheming="false" BackColor="Transparent" OnImageSaving="ImageEditor_ImageSaving"
        StatusBarMode="Hidden" CanvasMode="No" ToolBarPosition="top" BorderStyle="Solid"
        BorderWidth="0px" Visible="false" OnClientImageLoad="ImageLoad" OnClientImageChanged="ImageChanged">
        <Tools>
            <telerik:ImageEditorToolGroup>
                <telerik:ImageEditorTool CommandName="Flip" />
                <telerik:ImageEditorTool CommandName="FlipVertical" />
                <telerik:ImageEditorTool CommandName="FlipHorizontal" />
                <telerik:ImageEditorToolSeparator />
                <telerik:ImageEditorTool CommandName="Crop" />
                <telerik:ImageEditorTool CommandName="Resize" />
                <telerik:ImageEditorToolSeparator />
                <telerik:ImageEditorTool CommandName="Reset" />
            </telerik:ImageEditorToolGroup>
        </Tools>
    </telerik:RadImageEditor>
    </telerik:RadAjaxPanel>

父控件ascx.cs:

 protected void GridCenters_ItemCommand(object sender,Telerik.Web.UI.GridCommandEventArgs e)
{
    if (e.CommandName == RadGrid.UpdateCommandName || e.CommandName == RadGrid.PerformInsertCommandName)
    { controls_CustomControls_UploadImageControl_Maya ctrl = e.Item.FindControl("UploadImageControl1") as controls_CustomControls_UploadImageControl_Maya;
        if (ctrl.ImageFileName != "")
        {
            //string imageFileName = (e.Item.FindControl("AsyncUpload1") as RadAsyncUpload).UploadedFiles[0].FileName;
            ctrl.SaveImage();
            logo = ctrl.ImageFileName != "" ? ConvertImgToBinary(ctrl.ImageFileName) : null;
        }

        switch (e.CommandName)
        {
 case "Update":
    if(!EntertainmentDataAccess.UpdateCenter(long.Parse(e.CommandArgument.ToString()), centerName, centerType, logo, website, "", isactive, "", mail, tel, Mobile, fax, country, casa, town, street, BuildNb, POB))
                {
                    LblError.Text = "Branch cannot be updated";
                }
                else
                {
                    LblError.Text = "Branch updated successfully";
                    GridEditCommandColumn editColumn = (GridEditCommandColumn)GridCenters.MasterTableView.GetColumn("EDIT");
                    editColumn.Visible = true;

                    GridCenters.DataBind(); // here i'm getting the error
                }
                break;
        }
    }

我为我凌乱的解释感到抱歉,但我已经在这个问题上停留了几天而且我无法解决它