RadAjaxManager not working in Usercontrol, ContentPage, Masterpage

3 posts, 0 answers
  1. David
    David avatar
    8 posts
    Member since:
    Aug 2014

    Posted 27 Aug 2014 Link to this post

    Hi Admin!
    I have a proplem with RadAjaxManager. I have a usercontrol in Webpage. Webpage use tempalte MasterPager. When i press Button SendComment in UC. Page reload again. Can you show me a method to  solve this problem
    Usercontrol ASPX:
      <telerik:RadAjaxManagerProxy ID="uxRadAjaxManager" runat="server" EnableViewState="False">        
            <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="bt_sencomments">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="commentsContainer" LoadingPanelID="uxLoadingPanel" />
                </UpdatedControls>
            </telerik:AjaxSetting>           
        </AjaxSettings>    
        </telerik:RadAjaxManagerProxy>  
      <div id="commentsContainer">              
           <telerik:RadListView ID="RadListViewContainer" runat="server">
            <ItemTemplate>            
                        <div class="commentWrapper">
                            <img alt="avatar" src='<%#ProcessingImage((byte[])Eval("ProfilePicture"))  %>'>
                            <span>
                                <strong>From: </strong><%# Eval("FullName")%> - <%#Eval("CreatedDate")%>                            
                            </span>
                            <div class="commentContent">
                                <%# Eval("CommentContent")%>
                            </div>
                        </div>
                    </ItemTemplate>           
               </telerik:RadListView>
             
            </div>
            <div>          
                <p style="margin-left: 10px;"><b>Leave a comment</b> </p>
                <div class="commentForm">
                    <textarea cols="50" rows="10" runat="server" placeholder="Enter your comment here..."
                        id="commentField"></textarea>
                    <br />
                    <asp:Button   ID="bt_sencomments" Text="Send Comments"  OnClick="bt_sencomments_Click" OnClientClick="return validate();"
                        runat="server"></asp:Button>
                      
                    

                </div>
            </div>
    Mywebpage:


    <%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeBehind="ArticleDetail.aspx.cs" Inherits="ICSCMWA.News.ArticleDetail" %>

    <%@ Register Src="~/UC/ArticleViewDetails.ascx" TagPrefix="uc1" TagName="ArticleViewDetails" %>


    <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
        
         <link rel="stylesheet" type="text/css" href="../Styles/ViewArticleDetail.css">
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
          
        <uc1:ArticleViewDetails runat="server" id="UCViewDeteail" NewsId="0"/>
    </asp:Content>
    <%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeBehind="ArticleDetail.aspx.cs" Inherits="ICSCMWA.News.ArticleDetail" %>

    <%@ Register Src="~/UC/ArticleViewDetails.ascx" TagPrefix="uc1" TagName="ArticleViewDetails" %>


    <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
        
         <link rel="stylesheet" type="text/css" href="../Styles/ViewArticleDetail.css">
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
          
        <uc1:ArticleViewDetails runat="server" id="UCViewDeteail" NewsId="0"/>
    </asp:Content>

    My masterpage:
    <telerik:RadAjaxManager ID="uxRadAjaxManager" runat="server" EnableAJAX="true" DefaultLoadingPanelID="uxLoadingPanel">
    <%--<ClientEvents OnRequestStart="requestStart" OnResponseEnd="responseEnd" />--%>
    </telerik:RadAjaxManager>         
    <telerik:RadAjaxLoadingPanel ID="uxLoadingPanel" EnableAjaxSkinRendering="true" runat="server" RegisterWithScriptManager="true" Skin="Silk">

    </telerik:RadAjaxLoadingPanel>


  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 29 Aug 2014 in reply to David Link to this post

    Hi David,

    Unfortunately I couldn't replicate the issue at my end. Please have a look into this help documentation for further help.

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1795 posts

    Posted 01 Sep 2014 Link to this post

    Hello David,

    The first issue with the provided markup is that the DIV element that you are including in the AJAX settings is not a server control and you should at least at runat="server" or use Panel control instead.

    The second issue is that you are setting the OnClientClick event of the button for executing some custom validation, but please note that when you are setting "return validation();" to the OnClientClick event, the actual handler for the click event will be:
    onclick="return validate();__doPostBack('bt_sencomments','')"

    As you can notice, the _doPostBack() will never occur, so you should use some other approach for your custom validation, so the _doPostBack() function could be properly called.

    Hope this helps.



    Regards,
    Konstantin Dikov
    Telerik
     

    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