473,396 Members | 2,020 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Define Relative Folder path in Web.Config

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
Nov 18 '05 #1
2 6410
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" <ha*******@gatewaytechnolabs.com> wrote in message
news:O0**************@TK2MSFTNGP11.phx.gbl...
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

Nov 18 '05 #2
Hi Kevin,

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

Harsh
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:e7**************@TK2MSFTNGP09.phx.gbl...
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" <ha*******@gatewaytechnolabs.com> wrote in message
news:O0**************@TK2MSFTNGP11.phx.gbl...
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


Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: jason | last post by:
Can anyone help me find a solution to quickly working out relative paths to a folder in the root of my server... Although it easy when you go - say - two levels down: .../includes it...
15
by: Nick K. | last post by:
I recently began maintenance work on a production web server that is located in the root directory of a web server. I moved this into a sub web on my local web server in order to do work on it. I...
8
by: dw | last post by:
Hello, all. I have a site that I'm testing on my LOCALHOST and also on a remote server, depending on whether I'm at work or at home. I don't want the OLEDBDATAAdapter to be pointing to the remote...
6
by: openleren | last post by:
Hi all, how can I use a relative path in my web.config file for an Access db?: Instead of using <configuration> <appSettings> <add key="conAccess" value="microsoft.jet.oledb.4.0;data...
18
by: Nak | last post by:
Hi there, Does anyone know what path the AssemblyKeyFile attribute is relative to? For example I currently have mine set to <Assembly: AssemblyKeyFile("..\NicksKey.snk")> Sometimes this...
8
by: Topper | last post by:
Hello. I have simple web folders structure: -ROOT - BIN WebService.dll WebService.asmx I need to use my WebService.dll not in bin folder - for example, in ROOT. How do i this? How can i do...
1
by: Stephen Kay | last post by:
If you are dynamically loading pages, through php, from inside a folder that have relative links to images inside the same folder, into another document (a template) in a different folder level,...
1
by: =?Utf-8?B?Uk1C?= | last post by:
I am using the Configuration Application Block, and I want to keep my config files in a folder off of the app root called config. I have modified the app.config to point to the folder with a...
2
chathura86
by: chathura86 | last post by:
I'm new to ASP.NET i'm new to asp.net i created a class which reads a xml file placed the class in the app_code folder and placed the xml file in another folder both folders are in the root ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.