473,785 Members | 2,326 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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********@hotm ail.com
http://www.nathansokalski.com/
Sep 22 '06 #1
2 1823
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.asc x. 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********@hot mail.comwrote in message
news:eX******** ******@TK2MSFTN GP03.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********@hotm ail.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 programmaticall y 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********@hotm ail.com
http://www.nathansokalski.com/

"Baski" <ba***@aldensys .comwrote in message
news:eT******** ******@TK2MSFTN GP03.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.asc x. 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********@hot mail.comwrote in message
news:eX******** ******@TK2MSFTN GP03.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********@hotm ail.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
3441
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 is: can the changes made by the user to the settings values be saved back to "app.config" so that when the application is launched tomorrow, the updated values are used? Since the original app.config settings are loaded to...
1
1438
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 not reading it because i DO have customErrors mode=Off Why won't it use this file!? Thanks
1
1971
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 page. I have the June Atlas CTP installed.
3
3822
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" runat="server"> I get this error message:
2
1592
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 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...
5
2435
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" tagName="Navigation" src="~/Navigation.ascx"/> </controls> </pages>
0
2044
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 config is as follows... <system.web> <authorization> <deny users="?" /> </authorization>
1
1062
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 installation folder for the .exe.config. Ideas on how to best do this. Thanks,
2
6563
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 converted to an application running in ..NET 2.X and Integrated mode. We copied over the DB and edited the web.config file to the DB username and password. I also added the NETWORK SERVICE user to the DB.
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9489
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10100
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6744
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5396
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5528
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2893
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.