This is a migrated thread and some comments may be shown as answers.

RadAjaxManager not working in Usercontrol, ContentPage, Masterpage

2 Answers 59 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 28 Aug 2014, 02:55 AM
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 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 29 Aug 2014, 11:23 AM
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.
0
Konstantin Dikov
Telerik team
answered on 01 Sep 2014, 10:42 AM
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.

 
Tags
Ajax
Asked by
David
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Konstantin Dikov
Telerik team
Share this question
or