Postback on first select, ajax call next ?

4 posts, 0 answers
  1. CSurieux
    CSurieux avatar
    465 posts
    Member since:
    Jan 2007

    Posted 17 Mar 2008 Link to this post

    Hello,

    It have an ascx with a RadAjaxManagerProxy + a RadTreeview + RadGrid
    The grid disply info from the selected node in the treeview.

    After first display of the page, when I select a node, I get a postback.
    Then I select another node and it is an Ajax call ?

    How to get rid of this initial postback ?
    Could you help find my error, here is my ascx code ?

    Thanks
    CS

    <%@ Control Inherits="AddonNice.WTPageModules.Pages.PortalPagesManager" Language="c#"
        AutoEventWireup="False" CodeBehind="PortalPagesManager.ascx.cs" %>
    <%@ Register Assembly="Telerik.Web.UI"    Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

    <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat=server />
    <telerik:RadCodeBlock ID="CodeBlock1" runat="server">
    <script type="text/javascript">
    <!--
    //<![CDATA[
    function ContextMenuClick(node, itemText,itemID)
    {    
     if (itemID == "EditName")
     {  
      node.StartEdit();
     }
     return true;
    }

    //]]>
    // -->
    </script>
    </telerik:RadCodeBlock>
    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProx1" runat="server" >
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="DeleteBtn" >
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTree1" LoadingPanelID="AjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="AjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadTree1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTree1" LoadingPanelID="AjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="AjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
    <table cellpadding="5" cellspacing="0">
        <tr>
            <td colspan="3">
                <table>
                    <tr>
                        <td align="left">
                            <asp:Literal ID="Literal1" Text="<%$ Resources:ResourcesWTCRM,AM_TREEVIEW_HELP %>"
                                runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td align="center">
                            <asp:ImageButton ID="RenameBtn" SkinID="RenameBtn" AlternateText="<%$ Resources:ResourcesWTCRM,AM_CONTEXT_EDITNAME %>"
                                runat="server" />
                            <asp:ImageButton ID="EditBtn" SkinID="EditBtn" AlternateText="<%$ Resources:ResourcesWTCRM,EDITBTN %>"
                                runat="server" />
                            <asp:ImageButton ID="DeleteBtn" SkinID="DeleteBtn" AlternateText="<%$ Resources:ResourcesWTCRM,DELETEBTN %>"
                                runat="server" />
                            <asp:ImageButton ID="addBtn" SkinID="AddPage" AlternateText="<%$ Resources:ResourcesWTCRM,ADDTAB %>"
                                runat="server" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr valign="top">
            <td>
                <telerik:RadTreeView ID="RadTree1" AllowNodeEditing="True" MultipleSelect="False"
                    Skin="Web20" Width="400" runat="server" BeforeClientContextClick="ContextMenuClick"
                    DragAndDrop="True" DragAndDropBetweenNodes="True" CausesValidation="false" ShowLineImages="false"
                    AutoPostBack="true" />
            </td>
            <td align="left">
                <telerik:RadGrid ID="RadGrid1" runat="server" GridLines="None" Skin="Web20" Width="400px"
                    AutoGenerateColumns="False">
                    <MasterTableView>
                        <ExpandCollapseColumn Visible="False" Resizable="False">
                            <HeaderStyle Width="20px" />
                        </ExpandCollapseColumn>
                        <RowIndicatorColumn Visible="False">
                            <HeaderStyle Width="20px" />
                        </RowIndicatorColumn>
                        <Columns>
                            <telerik:GridBoundColumn DataField="Name" HeaderText="<%$ Resources:ResourcesWTCRM,AM_NAME %>"
                                ItemStyle-Width='200' UniqueName="Name">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Parameter" HeaderText="<%$ Resources:ResourcesWTCRM,AM_PARAMETER %>"
                                ItemStyle-Width='400' UniqueName="Parameter">
                            </telerik:GridBoundColumn>
                        </Columns>
                    </MasterTableView>
                    <ExportSettings>
                        <Pdf PageBottomMargin="" PageFooterMargin="" PageHeaderMargin="" PageHeight="11in"
                            PageLeftMargin="" PageRightMargin="" PageTopMargin="" PageWidth="8.5in" />
                    </ExportSettings>
                </telerik:RadGrid>
            </td>
            <td>
                <telerik:RadAjaxLoadingPanel ID="AjaxLoadingPanel1" runat="server" Height="75px"
                    Width="75px" Style="position: absolute; left: 500px; top: 200px" IsSticky="True"
                    Transparency="50">
                    <asp:Image ID="Image1" runat="server" AlternateText="Loading..."  SkinID="WT_LoadingProgressBarr" >
                    </asp:Image>
                </telerik:RadAjaxLoadingPanel>
            </td>
        </tr>
    </table>

  2. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 20 Mar 2008 Link to this post

    Hello Christian Surieux,

    I have prepared a small project for you. It contains three aspx pages, a user control and a master page.
    The user control has RadAjaxManagerProxy, RadTreeView and RadGrid. Clicking on a node shows the appropriate records in the grid.
    • default.aspx page contains RadAjaxManager and the user control. In Page_Load event handler I check        if (RadAjaxManager1.IsAjaxRequest) and it is true every time I click on a node - so no postback.
    • default2.aspx page has the user control placed in it and uses the Master page. The Master page contains RadAjaxManager. In the master page's Page_Load event handler I check                                              if (RadAjaxManager1.IsAjaxRequest) and it is true every time I click on a node - so no postback.
    • default3.aspx page does not use the user control. It just have a treeview, a grid and a RadAjaxManager. In its Page_Load event handler I again check if (RadAjaxManager1.IsAjaxRequest) and it is true every time I click on a node - so no postback.
    You can download the project and give it a try.

    Greetings,
    Veskoni
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. CSurieux
    CSurieux avatar
    465 posts
    Member since:
    Jan 2007

    Posted 28 Mar 2008 Link to this post

    Hello Veskoni,

    Sorry I have started another thread on this subject because I have loosed this one, due to my inattention.
    I worked around your sample but I am still unable to reproduce my problem.
    I am very disapointed, and I think that I'am experimenting an already encountered error due to scriptmanager and javascript loading and validation.
    As if scriptmanager/RadAjaxManager was not correctly loaded for the first display of my page.

    Any new information for me ?

    Regards
    CS
  5. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 31 Mar 2008 Link to this post

    Hello Christian Surieux,

    I believe the best way to proceed is to send us a simple project that demonstrates the problem.

    Thanks for your time and cooperation.

    All the best,
    Veskoni
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top