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:
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