Server.MapPath in .NET

  • Thread starter Thread starter Jay
  • Start date Start date
J

Jay

How do you say Server.MapPath in the web config file .NET. I am trying to
put an entry in the web config file which points to the current bin
directory where my database resides.

Thank You for any help with this!
 
Hi,

You can use Request.PhysicalApplicationPath and append with 'bin' to get the
physical path to the app bin folder instead of hardcoding the path in the
config file.

HTH.

How do you say Server.MapPath in the web config file .NET. I am trying to
put an entry in the web config file which points to the current bin
directory where my database resides.

Thank You for any help with this!
 
I guess what I am asking: is it possible to dynamically change the
web.config file depending on the which server it resides on or is the
web.config static?
 
Oops, sorry about that :-(

Since web.config file is nothing but a valid XML file, use System.Xml types
to manipulate the sections. An example could be found here:
http://www.abstractvb.com/code.asp?A=1093

Hope this is what you are lookin for.

I guess what I am asking: is it possible to dynamically change the
web.config file depending on the which server it resides on or is the
web.config static?
 
Back
Top