asp.net mvc - Open image in a new window using Razor and javascript -


i'm trying open in new window new full size image each one. i'm using code:

<script type="text/javascript"> function openimage(imageurl) {     window.open(imageurl); } 

@foreach (var image in model.images) {         <img src="@url.action("thumbnail", "done", new { width = 150, height = 150, file = @imagen.filename })" alt="@imagen.filename" onclick="openimage('@url.content(viewbag.path + @imagen.filename)')" /> } 

but using when click on image can't open anything.

can me issue?

thank in advanced

edited function openimage due wrong code

the solution url of directory saved images in way: string url = url.content("~/images");


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -