.NETGURU
Treeview and TreeNodeSrc Path problems
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngwebcontrols' list.


Julian Voelcker
I have been following the notes provided by the IE Team for creating a dynamic treeview quoted below and have hit a problem.

When I run the code I get the error There is invalid data at the root level. Line 1, position 1.

If I take the xml and save it as a file and then set the TreeNodeSrc to the xml file using something like "http://www.domain.com/menu.xml"; or even "/menu.xml" I still get the error.

If I use the physical path to the menu.xml file it all works fine.

The problem is I can't fire the stored procedure from a physical path.

Do any of you have any ideas?

Cheers,

Julian Voelcker
The Virtual World (UK) Limited
Cirencester, United Kingdom

On Tue, 10 Jul 2001 08:27:46 -0700, IE WebControls Q & A (External) wrote:
[Original message clipped]

Reply to this message...
 
    
James Avery
What sort of security is implemented on this directory? If you enter the url
to the xml in your browser do you see the correct xml?

-----Original Message-----
From: Julian Voelcker [mailto:Click here to reveal e-mail address]
Sent: Saturday, April 13, 2002 8:43 AM
To: aspngwebcontrols
Subject: [aspngwebcontrols] Treeview and TreeNodeSrc Path problems

I have been following the notes provided by the IE Team for creating a
dynamic treeview quoted below and have hit a problem.

When I run the code I get the error There is invalid data at the root level.
Line 1, position 1.

If I take the xml and save it as a file and then set the TreeNodeSrc to the
xml file using something like "http://www.domain.com/menu.xml"; or even
"/menu.xml" I still get the error.

If I use the physical path to the menu.xml file it all works fine.

The problem is I can't fire the stored procedure from a physical path.

Do any of you have any ideas?

Cheers,

Julian Voelcker
The Virtual World (UK) Limited
Cirencester, United Kingdom

On Tue, 10 Jul 2001 08:27:46 -0700, IE WebControls Q & A (External) wrote:
[Original message clipped]

pid=0"http://localhost/XMLTest?sql=execute+sp_XMLTreeViewData+@pid=0"
[Original message clipped]

| [aspngwebcontrols] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngwebcontrols.asp = JOIN/QUIT

Reply to this message...
 
    
Julian Voelcker
There is no special security and the I see the correct xml.

I have had this problem with the treeview elsewhere where the xml file
was just in the root of a standard website. All was ok until I copied
the project to another folder.

I have seen discussion of security issues here, but can't see what is
wrong with the setup.

Some further details would be appreciated.

Cheers,

Julian Voelcker
The Virtual World (UK) Limited
Cirencester, United Kingdom

Reply to this message...
 
    
James Avery
To see all the different issues I would check the archives as most of this
happened right around the switch to V1 webcontrols. As I understand it the
web controls do not access the xml in the current process, it does so
independent of the current user or process so it cause issues if the folder
is set to anything other than anonymous. If you are using any sort of
authentication then it will usually fail. I was using basic authentication
and the solution for me was to put the xml file in the wwwroot and run it
from there, I could have also probably changed the security setting for just
that file to be anonymous. You could also try setting asp.net to run using
system (in machin.config) and see if it works then, I would not leave it
this way though. If this works then try giving the aspnet account access to
the directory or file.

-----Original Message-----
From: Julian Voelcker [mailto:Click here to reveal e-mail address]
Sent: Saturday, April 13, 2002 3:01 PM
To: aspngwebcontrols
Subject: [aspngwebcontrols] Re: Treeview and TreeNodeSrc Path problems

There is no special security and the I see the correct xml.

I have had this problem with the treeview elsewhere where the xml file
was just in the root of a standard website. All was ok until I copied
the project to another folder.

I have seen discussion of security issues here, but can't see what is
wrong with the setup.

Some further details would be appreciated.

Cheers,

Julian Voelcker
The Virtual World (UK) Limited
Cirencester, United Kingdom

| [aspngwebcontrols] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngwebcontrols.asp = JOIN/QUIT

Reply to this message...
 
    
Julian Voelcker
Hi James,

This is very disturbing to know that you have to start messing around
with the security of the site to get these things to work and that
there doesn't seem to be any firm documentation on it.

I have all the messages for this list going back a year and there
doesn't seem to be any firm answers - there are lot of messages saying
try this or try that, but nothing concrete.

Bearing in mind that I was following the MS guidelines (see original
post) I am surprised that it didn't work.

Bearing in mind that ideally I don't want to us a physical file
preferring to go the stored procedure route, I assume that it is the
permissions on the virtual directory that I need to configure.

Further help would be appreciated.

Cheers,

Julian Voelcker
The Virtual World (UK) Limited
Cirencester, United Kingdom

Reply to this message...
 
    
James Avery
I agree, we have never gotten a firm response from Microsoft on how this
should be done. After V1 we were originally told you had to use a physical
path, but that is not true since I use a virtual in my applications. What
are your current permissions on the virtual directory?? The first thing to
try is to access the file through the IIS manager and set the permission on
that file to anonymous.

-----Original Message-----
From: Julian Voelcker [mailto:Click here to reveal e-mail address]
Sent: Sunday, April 14, 2002 4:51 AM
To: aspngwebcontrols
Subject: [aspngwebcontrols] Re: Treeview and TreeNodeSrc Path problems

Hi James,

This is very disturbing to know that you have to start messing around
with the security of the site to get these things to work and that
there doesn't seem to be any firm documentation on it.

I have all the messages for this list going back a year and there
doesn't seem to be any firm answers - there are lot of messages saying
try this or try that, but nothing concrete.

Bearing in mind that I was following the MS guidelines (see original
post) I am surprised that it didn't work.

Bearing in mind that ideally I don't want to us a physical file
preferring to go the stored procedure route, I assume that it is the
permissions on the virtual directory that I need to configure.

Further help would be appreciated.

Cheers,

Julian Voelcker
The Virtual World (UK) Limited
Cirencester, United Kingdom

| [aspngwebcontrols] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngwebcontrols.asp = JOIN/QUIT

Reply to this message...
 
    
Julian Voelcker
I have tried it with the virtual directory configured for anonymous access
using the IUSR_machinename account, but that failed.

Even creating the XML file and trying to access that has caused problem.

It sounds like the key to is to find out which user account the TreeView
control uses and then try to provide that user with permissions to the XML
file/virtual directory depending on what you are doing.

Any ideas?

Cheers,

Julian Voelcker
The Virtual World (UK) Limited
Cirencester, United Kingdom

On Sun, 14 Apr 2002 11:19:56 -0400, James Avery wrote:
[Original message clipped]

Reply to this message...
 
    
Julian Voelcker
Thanks, but there isn't anything wrong with the XML that is generated
because I can get it to work ok when I link directly to it.

Cheers,

Julian Voelcker
The Virtual World (UK) Limited
Cirencester, United Kingdom

Reply to this message...
 
    
James Avery
Did you try setting the account used by ASP.net to System to see if it
worked then?

-----Original Message-----
From: Julian Voelcker [mailto:Click here to reveal e-mail address]
Sent: Monday, April 15, 2002 4:31 AM
To: aspngwebcontrols
Subject: [aspngwebcontrols] Re: Treeview and TreeNodeSrc Path problems

I have tried it with the virtual directory configured for anonymous
access
using the IUSR_machinename account, but that failed.

Even creating the XML file and trying to access that has caused problem.

It sounds like the key to is to find out which user account the TreeView

control uses and then try to provide that user with permissions to the
XML
file/virtual directory depending on what you are doing.

Any ideas?

Cheers,

Julian Voelcker
The Virtual World (UK) Limited
Cirencester, United Kingdom

On Sun, 14 Apr 2002 11:19:56 -0400, James Avery wrote:
[Original message clipped]

| [aspngwebcontrols] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngwebcontrols.asp = JOIN/QUIT

Reply to this message...
 
    
Julian Voelcker
On Mon, 15 Apr 2002 10:32:47 -0400, James Avery wrote:
[Original message clipped]

Are you referring to the ASP.net State Service on the server? This is
currently configured to run as a local system account.

Cheers,

Julian Voelcker
The Virtual World (UK) Limited
Cirencester, United Kingdom

Reply to this message...
 
    
James Avery
There is a setting in the machine.config that sets how asp.net should
run on your system. There are two setting, system and machine, the
default being machine. Machine runs as the aspnet user account, System
runs as part of the operating system. Try changing this value to System
and see if that fixes the issue, also try moving the file or calling the
file from the wwwroot directory instead of the directory that contains
authentication.

-----Original Message-----
From: Julian Voelcker [mailto:Click here to reveal e-mail address]
Sent: Monday, April 15, 2002 11:52 AM
To: aspngwebcontrols
Subject: [aspngwebcontrols] Re: Treeview and TreeNodeSrc Path problems

On Mon, 15 Apr 2002 10:32:47 -0400, James Avery wrote:
> Did you try setting the account used by ASP.net to System to see if it

> worked then?

Are you referring to the ASP.net State Service on the server? This is
currently configured to run as a local system account.

Cheers,

Julian Voelcker
The Virtual World (UK) Limited
Cirencester, United Kingdom

| [aspngwebcontrols] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngwebcontrols.asp = JOIN/QUIT

Reply to this message...
 
    
Julian Voelcker
Hi James,

Thank for the response, I appreciate your patience!

OK, the setting for processModel-username in the web config is already set
to SYSTEM - I do recall setting this a few months back because .net wasn't
working properly.

If I change it back to Machine, nothing seems to work.

If I am testing using an actual XML file, it won't work regardless of
where I put it on the site unless I provide a physical path to it.

As previously stated I have the TreeNodeSrc set to a URL of a virtual
directory that uses a stored procedure to generate the XML from an SQL
database.

For reference the code in the aspx for the TreeView is as follows:-

<iewc:TreeView runat="server" id="TreeView1" autopostback="true"
TreeNodeSrc="http://admin.charityskills.org/XML?
sql=execute+sp_XMLTreeViewData+@pid=139" />

If you check out the URL you will see the XML that is generated, which
works fine when saved as a file and referenced using the physical path.

Any more ideas?

Cheers,

Julian Voelcker
The Virtual World (UK) Limited
Cirencester, United Kingdom

On Mon, 15 Apr 2002 13:04:16 -0400, James Avery wrote:
[Original message clipped]

Reply to this message...
 
    
James Avery
I can tell you a couple things.

1)I run two separate applications that use dynamically creating xml to
populate treeviews. I create the xml from an .aspx, and it works
perfectly. I access the file through a "virtual" path.

2)The one issue I had was solved by moving the .aspx file from the
virtual directory to the wwwroot.

You mentioned before that you had some type of security on the folder,
using the web.config. This could be the problem. Move the file into
the wwwroot folder and see what happens.

The other thing I just noticed that could be the issue is that your xml
file does not have
<?xml version="1.0" ?>

At the top of the file.

HTH,

James

-----Original Message-----
From: Julian Voelcker [mailto:Click here to reveal e-mail address]
Sent: Monday, April 15, 2002 5:46 PM
To: aspngwebcontrols
Subject: [aspngwebcontrols] Re: Treeview and TreeNodeSrc Path problems

Hi James,

Thank for the response, I appreciate your patience!

OK, the setting for processModel-username in the web config is already
set
to SYSTEM - I do recall setting this a few months back because .net
wasn't
working properly.

If I change it back to Machine, nothing seems to work.

If I am testing using an actual XML file, it won't work regardless of
where I put it on the site unless I provide a physical path to it.

As previously stated I have the TreeNodeSrc set to a URL of a virtual
directory that uses a stored procedure to generate the XML from an SQL
database.

For reference the code in the aspx for the TreeView is as follows:-

<iewc:TreeView runat="server" id="TreeView1" autopostback="true"
TreeNodeSrc="http://admin.charityskills.org/XML?
sql=execute+sp_XMLTreeViewData+@pid=139" />

If you check out the URL you will see the XML that is generated, which
works fine when saved as a file and referenced using the physical path.

Any more ideas?

Cheers,

Julian Voelcker
The Virtual World (UK) Limited
Cirencester, United Kingdom

On Mon, 15 Apr 2002 13:04:16 -0400, James Avery wrote:
[Original message clipped]

| [aspngwebcontrols] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngwebcontrols.asp = JOIN/QUIT

Reply to this message...
 
 
System.Windows.Forms.TreeView




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification