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

Strange behaviour when Rendering RadAjaxManager

4 Answers 70 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Denny
Top achievements
Rank 2
Denny asked on 29 Jul 2008, 10:58 AM

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 

4 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 29 Jul 2008, 11:10 AM
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.
0
Denny
Top achievements
Rank 2
answered on 29 Jul 2008, 11:43 AM
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
0
Denny
Top achievements
Rank 2
answered on 21 Aug 2008, 11:42 AM
any suggestions? anyone?

thanks

Denny
0
Mishel
Top achievements
Rank 1
answered on 21 Aug 2008, 11:47 AM
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
Tags
Ajax
Asked by
Denny
Top achievements
Rank 2
Answers by
Maria Ilieva
Telerik team
Denny
Top achievements
Rank 2
Mishel
Top achievements
Rank 1
Share this question
or