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

Discussion in 'Microsoft VB .NET' started by Nathan Sokalski, Sep 22, 2006.

  1. 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

    http://www.nathansokalski.com/
     
    Nathan Sokalski, Sep 22, 2006
    #1
    1. Advertisements

  2. Nathan Sokalski

    Baski Guest

    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" <> wrote in message
    news:...
    > 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
    >
    > http://www.nathansokalski.com/
    >
     
    Baski, Sep 22, 2006
    #2
  3. 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

    http://www.nathansokalski.com/

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

    >
    >
     
    Nathan Sokalski, Sep 22, 2006
    #3

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matthew Louden

    ASP.NET run-time error: ASP.NET ADO User Registered Failure

    Matthew Louden, Oct 11, 2003, in forum: Microsoft VB .NET
    Replies:
    1
    Views:
    219
    steve
    Oct 11, 2003
  2. Robert Bull

    asp.net web user controls

    Robert Bull, Apr 1, 2004, in forum: Microsoft VB .NET
    Replies:
    0
    Views:
    138
    Robert Bull
    Apr 1, 2004
  3. Nathan Sokalski
    Replies:
    5
    Views:
    1,141
    Gaurav Vaish \(www.Edujini-Labs.com\)
    Jan 10, 2007
  4. AshleyT
    Replies:
    1
    Views:
    165
    AshleyT
    Jun 27, 2008
  5. Ed.
    Replies:
    1
    Views:
    521
    Gregory A. Beamer
    Dec 10, 2009
Loading...

Share This Page