对于server.mappath我添加了命名空间system.web.ui,即使我没有添加server.mappath

编程入门 行业动态 更新时间:2024-10-12 22:33:38
本文介绍了对于server.mappath我添加了命名空间system.web.ui,即使我没有添加server.mappath的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

RptDoc.Load(Server.MapPath("~/CrystalReport.rpt"));

从下面的代码中,当我输入Server.MapPath时. 你给了解决方案 server.mapapth system.web 命名空间. 即使我添加了名称空间 system.web ,但 server.mappath 都没有出现,请帮助我.是否有任何参考文献想要添加. 请帮我.我尝试几次. 这是我的代码,如下所示

from the below code,when i type Server.MapPath is not coming. u given the solution system.web namespace for server.mapapth. even though i add the namespace system.web the server.mappath does not comes please help me.is there any Reference want to add. please help me.i try several times . this is my code as follows

ReportDocument RptDoc = new ReportDocument(); RptDoc.Load(Server.MapPath("~/CrystalReport.rpt")); RptDoc.SetDataSource(dt); CrystalReportViewer1.ReportSource = RptDoc; CrystalReportViewer1.DataBind();

从上面的代码

from the above code

RptDoc.Load(Server.MapPath("~/CrystalReport.rpt"));

即使我添加了 system.web.ui 命名空间,此行 Server.MapPath 也不会出现.

this line Server.MapPath does not comes even though i add a system.web.ui namespace.

推荐答案

尝试一下 System.Web.Hosting.HostingEnvironment.MapPath(〜") Try this System.Web.Hosting.HostingEnvironment.MapPath("~")

更多推荐

对于server.mappath我添加了命名空间system.web.ui,即使我没有添加server.mappath

本文发布于:2023-11-24 23:44:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1627398.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:使我   空间   mappath   server   ui

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!