Alternative of server.mappath() in my class

H

Han

Hello

I have an website having a class to be used by my .aspx, .asmx in the same
project. Also I have a common directory for XSL files. From .aspx I retrieve
the files by server.mappath("~..."). Now How do I do that in my class file?
Same way? or something another? The server.mapath() syntas in the class
raised compilation error.
 
M

Masudur

Hello

I have an website having a class to be used by my .aspx, .asmx in the same
project. Also I have a common directory for XSL files. From .aspx I retrieve
the files by server.mappath("~..."). Now How do I do that in my class file?
Same way? or something another? The server.mapath() syntas in the class
raised compilation error.

Hi...

try using the bellow code...

System.Web.HttpContext.Current.Server.MapPath();

Thanks
Md. Masudur Rahman (Munna)
Kaz Software Ltd.
www.kaz.com.bd
http://munnacs.110mb.com
 

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,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top