Strange behaviour when Rendering RadAjaxManager

5 posts, 0 answers
  1. Denny
    Denny avatar
    13 posts
    Member since:
    May 2008

    Posted 29 Jul 2008 Link to this post

    Hi I am trying to add the RadAjaxManager programmatically to a page and override the Render method on the page.  Here is my code:

    using System;  
    using System.Collections;  
    using System.Configuration;  
    using System.Data;  
    using System.Web;  
    using System.Web.Security;  
    using System.Web.UI;  
    using System.Web.UI.HtmlControls;  
    using System.Web.UI.WebControls;  
     
    using Telerik.Web.UI;  
    namespace Neetrix.Web.Administration.TempFiles  
    {  
        public partial class TestRender : Page  
        {  
             
            protected void Page_Load(object sender, EventArgs e)  
            {  
                RadAjaxManager AjaxManager = new RadAjaxManager();  
                AjaxManager.ID = "RadAjaxManager1";              
     
                HtmlForm form = new HtmlForm();  
                form.Controls.Add(new ScriptManager());  
     
                form.Controls.Add(AjaxManager);  
     
                form.Controls.Add(new LiteralControl("hello"));  
                this.Page.Controls.Add(form);  
            }  
     
            protected override void Render(HtmlTextWriter writer)  
            {  
                writer.Write("<html>");  
                base.Render(writer);  
                writer.Write("</html>");  
            }  
        }      
    }  
     

    After compiled and run it, it repeating itself when it reach the line "base.render(writer)". If you view page source on the page, you can clearly see that it duplicate both "<html>" and </html>" tags. If I took out the line "form.Controls.Add(AjaxManager)", it will behave correctly. So my question is, is it a bug or is there something i have missed? Thanks in advanced.

    Denny 
  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 29 Jul 2008 Link to this post

    Hi Denny,

     Please review the following help topic, which elaborates on adding the Ajax settings programatically. 
    I hope this helps.

    Kind regards,
    Maria Ilieva
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Denny
    Denny avatar
    13 posts
    Member since:
    May 2008

    Posted 29 Jul 2008 Link to this post

    Hi

    Thanks for the quick reply. The example link you given shows that I need to add the Ajax Manager control in the frontend and set the settings thru backend, but my problem is, I need to produce everything thru backend, I like to use RadAjaxManager, but is it possible to add it completely in the backend without those strange behaviour?

    Best Regards,

    Denny
  5. Denny
    Denny avatar
    13 posts
    Member since:
    May 2008

    Posted 21 Aug 2008 Link to this post

    any suggestions? anyone?

    thanks

    Denny
  6. Mishel
    Mishel avatar
    17 posts
    Member since:
    Jun 2008

    Posted 21 Aug 2008 Link to this post

    Hi,

    I had the same problem in my project.
    Unfortunately the only thing you could do is to add the manager in the .aspx page and make the setting programmatically
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017