1
Answer

In code Server.Mappath is not coming is there any reference want to add?

narasiman rao

narasiman rao

12y
2.6k
1
  RptDoc.Load(Server.MapPath("~/CrystalReport.rpt"));
 
from the below code,when i type Server.MapPath is not coming.is there any reference want to add.
 
please help me.
Answers (1)
0
Sandeep Singh Shekhawat
NA 22.4k 12m 12y
Server is property under "System.Web.UI" namespace and class is "Page". So are you sure that here we are using Page class (Inherit) of "System.Web.UI" namespace.

When we are working on .aspx.cs page that time this *.aspx.cs inherits System.Web.UI.Page class so we get Server.MapPath.

So please make sure that in your page you are using System.Web.UI.Page.

***************************************************************
Hi,

As per my understanding you are using Server.MapPath in your static method so Server.MapPath will not come in static method. 

Please check your method should not be static where you are using Server.MapPath.



Next Recommended Forum