Rank: Advanced Member Groups: Member
Joined: 4/14/2008 Posts: 33 Points: 99 Location: Cali Colombia
|
Hello, can someone tell me how to use the control Treeview in a page .aspx ?.It is generating an error rendering:
[NullReferenceException: Object reference not set to an instance of an object.] CSSFriendly.Helpers.HeadContainsLinkHref(Page page, String href) +48 CSSFriendly.Helpers.RegisterEmbeddedCSS(String css, Type type, Page page) +74 CSSFriendly.TreeViewAdapter.RegisterScripts() +84 CSSFriendly.TreeViewAdapter.OnInit(EventArgs e) +119 System.Web.UI.Control.InitRecursive(Control namingContainer) +8705966 System.Web.UI.Control.InitRecursive(Control namingContainer) +210 System.Web.UI.Control.InitRecursive(Control namingContainer) +210 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +378
thank you very much.
|
Rank: Administration Groups: Administration
, Member
Joined: 10/7/2008 Posts: 505 Points: 1,515
|
There seems to be a bug in the CSSFriendlyAdapters project (an old project to clean up asp.net html output). http://www.asp.net/cssadapters/http://cssfriendly.codeplex.com/http://code.google.com/p/aspnetcontroladapters/Not all controls had adapters. Custom adapters were added by contribs. As a fix: \Cuyahoga.Web\App_Browsers\CSSFriendlyAdapters.browser Comment out the entry for the TreeViewAdapter that is causing you the error. Code: < !-- < adapter controlType="System.Web.UI.WebControls.TreeView" adapterType="CSSFriendly.TreeViewAdapter" / > -- >
This should make things work again.
|
Rank: Administration Groups: Administration
, Member
Joined: 10/7/2008 Posts: 505 Points: 1,515
|
The TreeViewAdadpter tries to register javascripts directly to the page head: Code:// TreeViewAdapter.js Helpers.RegisterClientScript("CSSFriendly.JavaScript.TreeViewAdapter.js", type, this.Page); This throws a null reference error as Cuyahoga registers css and js to the template. So css friendly adapters that require js can not be used. I have never used the TreeView control with Cuyahoga and as such never had this error. It is good to know about it though.
|