User control file path problems

D

Dave

I've built a custom server control that reads an xml file and builds a
left side navigation system. When I drop that server control into a
user control that will hold the left side navigation for my site, I have
to set a property to the file name of the xml file.

The problem I'm having is that there are different levels of directories
and sub-directories that the user control will be used in and I cannot
use an absolute path, I have to use a relative path(there are different
servers/parent directories that are used in our 4 stage process from
development to production). But the relative path will change based on
which page the user control is used on.

Is there a way to tell a user control to get the relative path from it's
actual location, instead of the path being relative from the page the
user control is dropped on?

Big Dave
 
S

Scott Allen

HI Dave:

I'm not sure of all the scenarios you are in, but you might be able to
use ResolveUrl. This method is present on every control.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top