How to use Server.MapPath in Class File

Posted by Somasundaram under C# on 5/18/2012 | Points: 10 | Views : 10442 | Status : [Member] | Replies : 2
hi.,

I'm Using Visual Studio 2005,
how to use Server.MapPath inside the Class File

I'm Getting Error as Below:

Error	3	The name 'Server' does not exist in the current context	


Please Anybody tel how to use..

Thanks in Advance...

Regards,
Somasundaram




Responses

Posted by: Rajkatie on: 5/18/2012 [Member] [MVP] Gold | Points: 25

Up
0
Down
Use HttpContext.Current.Server.MapPath

Rajesh Patel
.Net Trainer(MSCD | MCT | MS)
Brainbench (Asp.Net 4.5 and C# 5.0)

Somasundaram, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Akiii on: 10/9/2012 [Member] Bronze | Points: 25

Up
0
Down
Also you have to have System.Web namespace


Thanks and Regards
Arka Dutta

Somasundaram, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response