c# - Why I can't use Server.MapPath() in my class? -


i have following problem when try call server.mappath(); inside class.

it give me following error message:

error 3 name 'server' not exist in current context c:\develop\earlywarning\public\implementazione\ver2\pdfreport\itextdocumentbase.cs 122 13 pdfreport

so think maybe have add namespace related server object looking on official documentation can't found no related namespace: http://msdn.microsoft.com/en-us/library/ms525541%28v=vs.90%29.aspx

why? can solve?

tnx

do in class:

system.web.httpcontext.current.server.mappath("relative path"); 

Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -