使用 asp.net MVC 检索 Orchard CMS 中的图像位置
我正在我的一个项目中使用 Orchard MVC。我试图创建自定义模块。我不认为这有什么问题。但是当我尝试将图像放入视图页面时,我遇到了问题。我不知道是路由问题还是果园本身的问题。
首先,模块的名称中带有“点”,如 Orchard。所以,如果我试图给出 Modules/Orchard.Name/Style/Images/1.jpg 的路径,它有 .在这之间我猜不是真的。如果我尝试像这样访问最终网址中的 ../../../Style/Images/1.jpg 它有 http://localhost/style/Images/1.jpg 这不是图像的路径。
如何访问图片的url。我是否必须定义自定义路由才能访问?或者还有其他解决方法吗?
I am using Orchard MVC to one of my project. I was trying to create custom module. I don't find any problem in that. But when I tried to put image in view page, I am facing problem. I don't know if problem is of Routing or Orchard it self.
First thing module has "dot" in its name like Orchard. so, if I am trying to giving path from Modules/Orchard.Name/Style/Images/1.jpg it has . in between which I guess not true. And if I trying to access like this ../../../Style/Images/1.jpg in final url it has http://localhost/style/Images/1.jpg which is not the path of Image.
How to access url of image. Do I have to define custom routes to access? Or is there any other workaround?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您所要做的就是查看代码中无数示例之一;)例如:
All you have to do is look at one of a bazillion examples in the code ;) Such as this: