Home All Groups Group Topic Archive Search About
Author
22 Sep 2006 9:22 PM
GroupReader
I have an ASP.Net 2.0 Treeview control that works fine in one virtual
directory, but not another.  Same webpage, but accessed with a
different virtual path.  Can anyone shed any light on the reason?

Here's the situation:
1)  I have a website called "MyWebSite"
2)  MyWebSite is accessible via two different virtual directories in
IIS:
  - http:// localhost / MyWebSite, and
  - http:// localhost / AnotherWebSite / MyWebSite
3)  When I access my treeview page like this, it works:
  - http:// localhost / MyWebSite / MyTreeviewPage.aspx
4)  When I access my treeview page like this, it doesn't work
  - http:// localhost / AnotherWebSite / MyWebSite /
MyTreeviewPage.aspx

Specifically, what does not work is all of the styles like nodeStyle,
hoverNodeStyle, selectedNodeStyle, etc... The styles don't show up at
all.  I think it has something to do with the *.axd resource files, but
I can't figure out what.  When I navigate directly to the *.axd files
by copying-and-pasting the urls into the browser, they all seem to
download just fine.

Also, my page has a MasterPage.  Could this have something to do with
it??

Any help would be appreciated. 

Thanks,
-dms

Author
22 Sep 2006 9:57 PM
GroupReader
After my original post, I verified that the problem *does* have
something to do with the master page.  If I remove the master page, I
no longer have the problem.  So... the problem has something to do with
the combination of the (1) MasterPage, (2) TreeView Control, and (3)
mutiple virtual directories.  Please help, I'm really stumped.

Thanks again,
-dms
Author
27 Sep 2006 9:10 PM
GroupReader
Solution: Give the master page an id: This is a well-known quirk with
master pages.


In master page:

void Page_Load
{
     ID="mp";
}
Author
3 Oct 2006 6:14 PM
Phil H
Dear GroupReader

I've got a problem with Treeview Styles as well but it's different to
yours.

My problem is that, for some reason if I try to use a home-spun image
with the "ImageUrl" property of NodeStyle it works fine but If I use a
second one with the SelectedNodeStyle property it ignores it! (By that
I mean it renders the same image as in NodeStyle)

I've also noticed by experiment that changing the formating of the text
elements of SelectedNodeStyle it works OK.

Have you or anyone else found this?