Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Retrieving image location in Orchard CMS using asp.net MVC

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?

like image 750
kunjee Avatar asked Feb 07 '12 19:02

kunjee


1 Answers

All you have to do is look at one of a bazillion examples in the code ;) Such as this:

<img class="icon" src="@Href("~/Modules/Orchard.Users/Content/Admin/images/online.gif") " alt="@T("Approved") " title="@T("User is approved") " />
like image 70
Bertrand Le Roy Avatar answered Oct 03 '22 19:10

Bertrand Le Roy