Referring to a User Control up one level in the Directory Structure

D

Dave

Greetings,

I have a web application that has a folder with a section of my web
application. How can I reference a user control that is one level up in the
directory structure?

<%@ Register TagPrefix="PHM" Tagname="HeaderMenu" src="HeaderMenu.ascx" %>

but, "HeaderMenu.ascx" is in the parent folder of the folder this aspx
document is in.

Thanks,

-Dave
 
J

john morales

Hello Dave,

as long as the acsx file is still within the project you can use the '~'
shortcut. Which expands to the root dir of your project.

so lets say for example you have

-/ (root project)
|
|- controls/
| |
| |--headerMenu.ascx
|
|-directory1/
|
|-directory2/
|
|--file1.aspx

file1.aspx should have something like <%@ Register ... src="~/controls/headermenu.ascx"
%>

-john
 
D

Dave

I figured it out. It should be

"../HeaderMenu.ascx"

Although I now have a new question in a new post.

-Dave
 

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

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top