PC Review


Reply
Thread Tools Rate Thread

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

 
 
Nathan Sokalski
Guest
Posts: n/a
 
      22nd Sep 2006
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
(E-Mail Removed)
http://www.nathansokalski.com/


 
Reply With Quote
 
 
 
 
Baski
Guest
Posts: n/a
 
      22nd Sep 2006
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
> (E-Mail Removed)
> http://www.nathansokalski.com/
>



 
Reply With Quote
 
 
 
 
Nathan Sokalski
Guest
Posts: n/a
 
      22nd Sep 2006
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
(E-Mail Removed)
http://www.nathansokalski.com/

"Baski" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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
>> (E-Mail Removed)
>> http://www.nathansokalski.com/
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why can't i put two controls in the same directory*? K Viltersten Microsoft ASP .NET 6 15th Sep 2009 10:08 PM
ASP.NET 2.0 won't let me put my user controls in the same directory as Web.config Nathan Sokalski Microsoft Dot NET 2 22nd Sep 2006 08:15 PM
ASP.NET 2.0 won't let me put my user controls in the same directory as Web.config Nathan Sokalski Microsoft ASP .NET 2 22nd Sep 2006 08:15 PM
Let OO Defrag put all files from directory xxxxx to the end of the harddisc space??? Thorsten Meyerling Windows XP General 1 12th Oct 2005 12:13 PM
Let OO Defrag put all files from directory xxxxx to the end of the harddisc space??? Thorsten Meyerling Windows XP Help 0 11th Oct 2005 03:08 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:29 PM.