Last post Feb 07, 2008 08:18 AM by willb75
Feb 06, 2008 05:39 AM|willb75|LINK
I was just playing about with the treeview control adapter, having used the default template project provided from the site. I just stuck a treeview on the default.aspx page, which doesn't have a server form (which I realised was the problem), and then bound
file and got the following error:
protected internal override
So I thought I'd try my luck at putting that code into the RenderContents method of the adapter, as follows:
void RenderContents(HtmlTextWriter writer)
TreeView treeView = Control
if (this.Page !=
And guess what, it works! I had a similar problem with another control, and I was scratching my head trying to figure out what was wrong, when I found that there are subtle differences like this which could cause a lot of development time
to be lost. After all, the only difference between the tailor-made and adapted rendering should be the mark-up itself...
Could anybody have a look at putting this code into the next release?
CSS Control Adapters
Treeview ExpandToState OnLoad
bugs and stuff
CSS Control Adapters Treeview
Feb 06, 2008 07:18 AM|vik20000in|LINK
that looks like a pretty good finding. I will look at this myself later. :-)
Feb 06, 2008 01:57 PM|bdemarzo|LINK
Can you confirm whether other CSS adapted controls have the same potential issue?
Feb 07, 2008 08:18 AM|willb75|LINK
I'm currently working on a project which will probably require other controls. I haven't used the others to be able to encounter the issue, but the easiest way to test each one is to instantiate and populate a web control outside a server form, and then
try commenting out the adapter mapping in the browsers file. If you get the error with the default asp.net rendering, but not the css adapter rendering, then the css adapter rendering is wrong. You'll need to add the following, or equivalent code, to the RenderContents
if (this.Page !=
I think there was another related but different issue I came across with the CSS adapters, where the ASP.NET form validation was failing, because there it was missing a call to a routine in the framework - I'll post that too when I get a moment.