User Interface using RADAJAXPanel

4 posts, 0 answers
  1. celerity12
    celerity12 avatar
    6 posts
    Member since:
    Jun 2013

    Posted 27 Jun 2013 Link to this post

    Please look into the below code snippet. Here I have RADAjaxPanels, splitter and some asp web controls.

    Program compiles well, at runtime it goes into code behind execute all the code (in debug mode confirmed this) although
    the issue i am having is the line of code gets executed it doesn't change Label color to red neither populates the Label with intended value.

    ASP file code snippet

    <!-- For Ajax Code Block -->
    <telerik:RadCodeBlock ID="RadCodeBlockLeftPane" runat="server">
        <script type="text/javascript">
            function invokeAjaxrequestLeftPane() {
                $find("<%= RadAjaxPanelLeftPane.ClientID%>").ajaxRequestWithTarget("<%= RadAjaxPanelLeftPane.UniqueID %>", "LoadDocumentFromLibrary");
            }
        </script>
    </telerik:RadCodeBlock>
     
    <telerik:RadSplitter ID="RadSplitterForPanel" runat="server" Height="1300" Width="100%" EnableViewState="false">
     
            <telerik:RadPane ID="PaneLeft" runat="server" Height="100%" Width="60%" Scrolling="Y">
     
                <asp:Label ID="LabelTest" runat="server" Text="Left Panel">
                       Left Pane
                </asp:Label>
     
                <input type="button" value="Load Document" onclick="invokeAjaxrequestLeftPane();" />
     
                <telerik:RadAjaxPanel ID="RadAjaxPanelLeftPane" runat="server" OnAjaxRequest="RadAjaxPanelLeftPane_AjaxRequest">
     
                </telerik:RadAjaxPanel>
     
            </telerik:RadPane>
             
            <telerik:RadSplitBar ID="RadSplitbarForPane" runat="server" CollapseMode="Both">
            </telerik:RadSplitBar>
     
            <telerik:RadPane ID="PaneRight" runat="server" Height="100%" Width="40%">
                Right Pane
     
            </telerik:RadPane>
     
     
        </telerik:RadSplitter

    Code Behind file method
    /// <summary>
            /// Ajax panel for loading the document from the library
            /// </summary>
            /// <param name="sender"></param>
            /// <param name="e"></param>
            protected void RadAjaxPanelLeftPane_AjaxRequest(object sender, AjaxRequestEventArgs e)
            {
                switch (e.Argument)
                {
                    case "LoadDocumentFromLibrary":
                        LabelTest.Text = " I am clicked at " + System.DateTime.Now;
                        LabelTest.BackColor = System.Drawing.Color.Red;
                        break;
                    default:
                        break;
                }//switch
            }//RadAjaxPanelLeftPane_AjaxRequest

    Thanks, Amit
  2. Eyup
    Admin
    Eyup avatar
    3013 posts

    Posted 02 Jul 2013 Link to this post

    Hi Amit,

    Please note that Ajax requests made by Ajax panels update only the controls inside the panel itself. Therefore, the label should be inside the RadAjaxPanel.

    Hope the clarification was helpful. Please make the suggested modification and let us know about the result.

    Regards,
    Eyup
    Telerik
    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 the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. celerity12
    celerity12 avatar
    6 posts
    Member since:
    Jun 2013

    Posted 16 Aug 2013 Link to this post

    Yeah, i was not using label.

    The problem was either the RadGrid.Rebind() or needdatasource eventhandler needs to be utilized for radgrid to display data in this scenario.


  5. Eyup
    Admin
    Eyup avatar
    3013 posts

    Posted 21 Aug 2013 Link to this post

    Hi Amit,

    I am glad that the issue was resolved. However, I do not see any RadGrid in the code snippets provided in your original post. If you need further assistance, please elaborate on your specific scenario.

    Regards,
    Eyup
    Telerik
    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 the blog feed now.
Back to Top