Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Define Relative Folder path in Web.Config

Reply
Thread Tools

Define Relative Folder path in Web.Config

 
 
Harshdeep Mehta
Guest
Posts: n/a
 
      08-10-2004
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


 
Reply With Quote
 
 
 
 
Kevin Spencer
Guest
Posts: n/a
 
      08-10-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
 
Harshdeep Mehta
Guest
Posts: n/a
 
      08-11-2004
Hi Kevin,

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

Harsh
"Kevin Spencer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

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
FileUpload control doesn't work (fail in client side early stages) when path is relative i.e "\\path.." Oren ASP .Net 1 04-29-2007 04:20 PM
How do I convert an absolute path into a relative path Nigel Wilkinson Ruby 2 07-25-2005 07:37 PM
absolute path versus relative path in JSP Matt Java 3 07-08-2004 08:31 PM
Make a relative url path from an absolute path to another one Thomas Guettler Python 3 10-27-2003 04:41 PM
define relative width using css Ingo Griegert HTML 1 10-20-2003 01:18 PM



Advertisments