Define Relative Folder path in Web.Config

H

Harshdeep Mehta

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
 
K

Kevin Spencer

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

Harshdeep Mehta

Hi Kevin,

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

Harsh
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top