ASP.NET 2.0 won't let me put my user controls in the same directory as Web.config

N

Nathan Sokalski

When I put my *.ascx files in the same directory as Web.config and my user
controls are registered in Web.config it gives me an error. Putting my
*.ascx files in another directory is not hard, but it can cause another
annoyance: relative directories. For example, that means that I need to
write code to add a ../ to the beginning of all relative directories used in
the user controls, which can be a real pain, especially if the directory is
being passed as a parameter and you do not know beforehand whether it is a
relative directory. Is there any way to allow me to put my *.ascx files in
the same directory as Web.config? Thanks.
 
B

Baski

How you are planning to use your user control ?. If you programatically
going to use all your user control all you have to do is create seprate
folder for all user control in your project root directory and use ../<your
control directory>/controlname.ascx. If you are going to use the control in
designer , let the VS.net do all the nessary work for you. Just drag and
drop your user control to the page where ever you want to use.
 
N

Nathan Sokalski

Several problems with that occur when a directory is entered as a user
control property. I want a way to programmatically access the directory of
the page that is using the user control. One of my goals is to use
MakeRelativeUri in my user controls, but I keep ending up with the control
directory before what would be the correct output. Any ideas? Thanks.
 

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