Define Relative Folder path in Web.Config

Discussion in 'ASP .Net' started by Harshdeep Mehta, Aug 10, 2004.

  1. Hi all gurus,

    Myself Harshdeep Mehta, you can call me Harsh.

    I struck up in a situation where I need to define relative path in
    Web.Config. I.e. suppose I have a "Export" named folder, besides Web.Config
    in same location or somewhere in reference to web.config. Then how to define
    that.

    I know one easy solution but need better than that. the easy solution is
    define folder path in web.config and use Server.mappath in code, but I need
    some stuff which gives me path direct from web.config, w/o using
    Server.Mappath().

    Helping hand will be appreciated.
    Thanks in advance,

    Have good time with code,
    Harshdeep Mehta
    Harshdeep Mehta, Aug 10, 2004
    #1
    1. Advertising

  2. The Server.MapPath() method has nothing to do with web.config. It returns a
    file path based upon a URL passed to it, regardless of what is in the
    web.config file. The web.config file is a text/xml document. You can't
    calculate a path in it. You can define one as a hard-coded string. That's
    your solution.

    --
    HTH,
    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    Big things are made up
    of lots of little things.

    "Harshdeep Mehta" <> wrote in message
    news:...
    > Hi all gurus,
    >
    > Myself Harshdeep Mehta, you can call me Harsh.
    >
    > I struck up in a situation where I need to define relative path in
    > Web.Config. I.e. suppose I have a "Export" named folder, besides

    Web.Config
    > in same location or somewhere in reference to web.config. Then how to

    define
    > that.
    >
    > I know one easy solution but need better than that. the easy solution is
    > define folder path in web.config and use Server.mappath in code, but I

    need
    > some stuff which gives me path direct from web.config, w/o using
    > Server.Mappath().
    >
    > Helping hand will be appreciated.
    > Thanks in advance,
    >
    > Have good time with code,
    > Harshdeep Mehta
    >
    >
    Kevin Spencer, Aug 10, 2004
    #2
    1. Advertising

  3. Hi Kevin,

    Thanks to invest your valuable time and effort, but can u give me a link
    which mentions your view.

    Harsh
    "Kevin Spencer" <> wrote in message
    news:...
    > The Server.MapPath() method has nothing to do with web.config. It returns

    a
    > file path based upon a URL passed to it, regardless of what is in the
    > web.config file. The web.config file is a text/xml document. You can't
    > calculate a path in it. You can define one as a hard-coded string. That's
    > your solution.
    >
    > --
    > HTH,
    > Kevin Spencer
    > .Net Developer
    > Microsoft MVP
    > Big things are made up
    > of lots of little things.
    >
    > "Harshdeep Mehta" <> wrote in message
    > news:...
    > > Hi all gurus,
    > >
    > > Myself Harshdeep Mehta, you can call me Harsh.
    > >
    > > I struck up in a situation where I need to define relative path in
    > > Web.Config. I.e. suppose I have a "Export" named folder, besides

    > Web.Config
    > > in same location or somewhere in reference to web.config. Then how to

    > define
    > > that.
    > >
    > > I know one easy solution but need better than that. the easy solution is
    > > define folder path in web.config and use Server.mappath in code, but I

    > need
    > > some stuff which gives me path direct from web.config, w/o using
    > > Server.Mappath().
    > >
    > > Helping hand will be appreciated.
    > > Thanks in advance,
    > >
    > > Have good time with code,
    > > Harshdeep Mehta
    > >
    > >

    >
    >
    Harshdeep Mehta, Aug 11, 2004
    #3
    1. Advertising

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

    Relative path in Web.Config

    Prateek, Jan 2, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    2,963
    Jim Cheshire [MSFT]
    Jan 2, 2004
  2. openleren

    relative path in web.config

    openleren, Sep 15, 2004, in forum: ASP .Net
    Replies:
    7
    Views:
    16,990
    ventura
    Sep 7, 2006
  3. =?Utf-8?B?bGVueWFkbw==?=
    Replies:
    2
    Views:
    415
    =?Utf-8?B?bGVueWFkbw==?=
    May 20, 2005
  4. Replies:
    3
    Views:
    1,123
    JP.Gantlin
    Oct 21, 2006
  5. CSharpner
    Replies:
    0
    Views:
    1,012
    CSharpner
    Apr 9, 2007
Loading...

Share This Page