473,325 Members | 2,870 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

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

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.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/
Sep 22 '06 #1
2 1416
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.
"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:eX**************@TK2MSFTNGP03.phx.gbl...
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.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

Sep 22 '06 #2
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.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Baski" <ba***@aldensys.comwrote in message
news:eT**************@TK2MSFTNGP03.phx.gbl...
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.
"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:eX**************@TK2MSFTNGP03.phx.gbl...
>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.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/


Sep 22 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Wayne Gibson | last post by:
Hi, Was wondering if anybody could point me in the right direction. I'm looking at developing a Windows User Control using Visual Studio .NET 2005 in C#. The user control is to be used on a web...
1
by: CaymanVisitor | last post by:
Hi, I have a situation where I need to iterate through a forms controls collection and I need to do special processing on any control that is a user control. At run-time I won't know the names...
4
by: Dot net work | last post by:
If I have got 2 web user controls on my aspx form, and one web user control has got some validator controls on it, what I find is that if I enter in some "bad data" in to some text boxes on the...
1
by: Robert Howells | last post by:
Perhaps I'm just too new at this to pull it off, or perhaps it's just bad architecture. I'd appreciate some feedback on the the wisdom (or lack thereof) in attempting the following: I'm not new...
2
by: Kiki | last post by:
Add user controls to programmatically specified location I have some data about a control I'm calling from a page. This control will be load n-th times on the page but only one option will be...
6
by: TomislaW | last post by:
How to find all user controls (ascx) loaded on a Page?
6
by: Gary Kahrau | last post by:
I am planning a very large project in vb.net and I want to make it modular. If the project needs 200-300 forms what do you think about creating a user control for each of these forms? The main...
8
by: mark.norgate | last post by:
I've run into a few problems trying to use generics for user controls (classes derived from UserControl). I'm using the Web Application model rather than the Web Site model. The first problem...
2
by: Nathan Sokalski | last post by:
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...
6
by: | last post by:
I have made some user controls with custom properties. I can set those properties on instances of my user controls, and I have programmed my user control to do useful visual things in response to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.