Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
hello everyone.
I need to set specific location as source for my images in my custom controller(view)
right now I'm using this code :
<img id="@item.Company"
style="height: auto; width:auto; max-height: 88px;max-width:88px" alt="@item.Id"
src="@Url.Action("MyImage", "MyController", new { path = item.Path, name = item.ImageName })"/>
and the action in controller :
[ChildActionOnly]
public ActionResult MyImage(string path, string name)
{
return File(@"" + path, name);
}
but, it doesn't work.
where could be the problem?
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
render image, using controller
hello everyone.
I need to set specific location as source for my images in my custom controller(view)
right now I'm using this code :
<img id="@item.Company"
style="height: auto; width:auto; max-height: 88px;max-width:88px" alt="@item.Id"
src="@Url.Action("MyImage", "MyController", new { path = item.Path, name = item.ImageName })"/>
and the action in controller :
[ChildActionOnly]
public ActionResult MyImage(string path, string name)
{
return File(@"" + path, name);
}
but, it doesn't work.
where could be the problem?
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.