Image acquisition in Orchard CMS using asp.net MVC

I am using Orchard MVC for one of my projects. I tried to create a custom module. I do not see this as any problem. But when I tried to put the image in the watch page, I ran into a problem. I do not know if the problem is routing or Orchard.

The module of the first thing has a β€œdot” in its name, for example, Orchard. so if I try to give a path from /Orchard.Name/Style/Images/1.jpg modules, it has. between which, I think, not so. And if I try to access, like this .. /../../Style/Images/1.jpg in the final URL, it http: //localhost/style/Images/1.jpg is not the image path.

How to access image url. Should I define custom routes for access? Or is there any other workaround?

+6
source share
1 answer

All you have to do is look at one of the bazillion examples in the code;) For example:

<img class="icon" src="@Href("~/Modules/Orchard.Users/Content/Admin/images/online.gif") " alt="@T("Approved") " title="@T("User is approved") " /> 
+5
source

Source: https://habr.com/ru/post/907870/


All Articles