473,320 Members | 1,957 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,320 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 1568
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

5
by: Dean Slindee | last post by:
I store several application settings in the project's "app.config" file. I also have a form that reads these values and displays them in a listview so that the user can adjust them. My question...
1
by: John | last post by:
Hi, Trying to troubleshoot a web app. I'm getting the usual "set your web.config file to customErrors mode="Off"" message. Anyway, I DO have a web.config file in the root of the app, but it's...
1
by: amir | last post by:
Hi, When compiling a page in VS2005 this morning I received 101 messages regarding schema problems in my web.config file. When I go to view an aspx page in my IIS, IE just displays a blank...
3
by: Tim_Mac | last post by:
Hi, i have this in my web.config: <pages validateRequest="false" > <controls> <add tagPrefix="uc1" src="/Whatever.ascx" tagName="Whatever"/> i have this in Login.aspx: <uc1:Whatever id="Blah"...
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...
5
by: Nathan Sokalski | last post by:
My Web.config file contains the following section to register some of my UserControls: <pages> <controls> <add tagPrefix="NATE" tagName="Banner" src="~/Banner.ascx"/> <add tagPrefix="NATE"...
0
by: ronscottlangham | last post by:
I have a web page that any authenticated user can access, but I dynamically enable/disable other asp.net controls on the web page based on the Role that they are in via C# code behind. My web...
1
by: =?Utf-8?B?QXNobGV5VA==?= | last post by:
I am using the .config and My.Settings to get my connection string. I need it to first look in some directory specific for the logged in user. If it isn't there then look to the program...
2
by: David Thielen | last post by:
So we have moved our app from .NET version 2.X in IIS6 to a Windows 2008 Server running IIS7. We have copied all files to the Windwardreports\apps directory and that apps directory has been...
1
by: =?Utf-8?B?VGVycnk=?= | last post by:
I am using the My.Settings object to save user settings. During testing, I want to 'zero' out what has been saved to start with the defaults again. Where doies the framwork actually persist these...
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
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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: 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...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.