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

Issue with RadTreeView

1 Answer 43 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Evandro Martins
Top achievements
Rank 1
Evandro Martins asked on 06 Jul 2010, 07:17 PM
Hello Guys,

I have a issue with RadTreeView,
I need to prerender this control for use caching, but i received the folowing message error:
Page cannot be null. Please ensure that this operation is being performed in the context of an ASP.NET request.
at Telerik.Web.UI.ScriptRegistrar.GetScriptManager(Control control)
at Telerik.Web.UI.RadDataBoundControl.RegisterScriptDescriptors()
at Telerik.Web.UI.RadDataBoundControl.Render(HtmlTextWriter writer)

The scriptmanager is in the Masterpage.

code:

RadTreeView orgVivo =

new RadTreeView();

 

 

orgVivo.NodeExpand +=

new RadTreeViewEventHandler(orgVivo_NodeExpand);

 

 

 

 

 

//Pupulate nodes method
PupulateNodes(
);
StringBuilder
sb = new StringBuilder();

 

 

StringWriter sw = new StringWriter(sb);

 

 

using (HtmlTextWriter writer = new HtmlTextWriter(sw))

{

orgVivo.RenderControl(writer);//error >>>

}

 

 

CacheEntry cacheEntry = new CacheEntry();

cacheEntry.Date =

DateTime.Now;

 

 

cacheEntry.Html = sb.ToString();

 

 

 

this.PartCacheWrite(Storage.Shared, CACHE_KEY, cacheEntry, new TimeSpan(0, 30, 0));

 

this.Controls.Add(orgVivo);


Can you help me in this issue ?

Thanks,

Evandro Martins

 

 

 

1 Answer, 1 is accepted

Sort by
0
Dimitar Milushev
Telerik team
answered on 12 Jul 2010, 03:44 PM
Hi Evandro,

Please refer to this blog post.

I hope this helps.

Greetings,
Dimitar Milushev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
TreeView
Asked by
Evandro Martins
Top achievements
Rank 1
Answers by
Dimitar Milushev
Telerik team
Share this question
or