RadGrid does postback when I try to use Ajax

2 posts, 0 answers
  1. Mike
    Mike avatar
    1 posts
    Member since:
    Jul 2014

    Posted 12 Dec 2014 Link to this post

    Good morning.

    This is my first post, so I will do my best to cover everything as thoroughly as possible. I am implementing a RadGrid in an ASP.NET project. Here are the particulars:

    Windows 7
    IE 11
    ASP.NET 4.5
    preferred language is VB
    latest version of Telerik Tools

    I have followed the instructions of several examples I've found online, including some here, but to no avail. No matter what I do, when I click any button in my RadGrid - Add, Edit, Cancel, etc. I get a PostBack. After clicking any button, all subsequent attempts to interact with the RadGrid fail due to the postback. I just want to use AJAX. Here is my RadGrid code:

    <telerik:RadGrid ID="attachment_list" runat="server"
        GroupPanelPosition="Top" >           
        <HeaderContextMenu EnableAutoScroll="True"
            NoMasterRecordsText="There are currently no attachments">
            <CommandItemSettings AddNewRecordText="Attach Another File" />                        
                <HeaderStyle Width="20px"></HeaderStyle
                <HeaderStyle Width="20px"></HeaderStyle
                <div ID="no_data_label">There are currently no attachments</div>
                <telerik:GridBoundColumn DataField="AttachmentPath" HeaderText="File Name" UniqueName="FileName" ItemStyle-Width="340px">  
                <telerik:GridBoundColumn DataField="AttachmentDescriptors" HeaderText="Description" UniqueName="Desc" ItemStyle-Width="450px">  
                <telerik:GridBoundColumn DataField="LastUpdatedDate" HeaderText="Updated Date" UniqueName="UpdatedDate" ItemStyle-Width="200px">  
                <telerik:GridBoundColumn DataField="UpdatedByName" HeaderText="Updated By" UniqueName="UpdatedBy" ItemStyle-Width="200px">  
                <telerik:GridButtonColumn ConfirmText="Are you sure you want to delete this item?" ConfirmDialogType="RadWindow" ConfirmTitle="Delete"
                    ButtonType="ImageButton" CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">
                    <ItemStyle HorizontalAlign="Center" CssClass="delete_button"></ItemStyle>
                <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                    <ItemStyle CssClass="edit_button"></ItemStyle>
            <EditFormSettings EditFormType="Template">
                    <asp:Panel ID="attachment_edit" runat="server" GroupingText='<%# IIf((TypeOf (Container) Is GridEditFormInsertItem), "Add an Attachment", "Update an Attachment")%>'>
                        <div class="inner_1">
                            <div class="float_left">
                                <asp:Panel ID="att_file_wrapper" runat="server">
                                    <div class="label">Select File:</div>               
                                    <telerik:RadUpload ID="att_file" runat="server" ReadOnlyFileInputs="True" ControlObjectsVisibility="none" ></telerik:RadUpload>
                                <div class="label">Description:</div><asp:TextBox ID="att_desc" runat="server" Text='<%# Bind("AttachmentDescriptors")%>'></asp:TextBox>                                  
                    <div class="btn_group_small">
                        <asp:Button runat="server" ID="add_task" Text='<%# IIf((TypeOf (Container) Is GridEditFormInsertItem), "Add Attachment", "Update Attachment")%>'
                            CommandName='<%# IIf((TypeOf (Container) Is GridEditFormInsertItem), "Insert", "Update")%>' CssClass="small_btn" />
                        <asp:Button runat="server" ID="cancel_task" Text="Cancel" CommandName="Cancel"
                            CausesValidation="False" CssClass="small_btn" />

    Here is my Ajax Manager code (my primary RadAjaxManager is in the Matser page):

    <telerik:RadAjaxManagerProxy ID="AjaxManagerProxy1" runat="server" >
                <telerik:AjaxSetting AjaxControlID="attachment_list">
                        <telerik:AjaxUpdatedControl ControlID="attachment_list" LoadingPanelID="RadAjaxLoadingPanel1"></telerik:AjaxUpdatedControl>                      

    I am fairly new to using Telerik (and .NET in general), and I'm on a tight deadline. Any assistance would be appreciated - thanks.
  2. Maria Ilieva
    Maria Ilieva avatar
    4017 posts

    Posted 16 Dec 2014 Link to this post

    Hello Mike,

    The most common reason for the presented issue is having the RadAjaxManager added before the ScriptManager in the MasterPage markup. Please make sure that the RadScriptManager or the asp ScriptManager is placed on the very top of the MasterPage before all control's declaration and see if this helps.

    Maria Ilieva

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top