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

symfony - TEST environment only: The database schema is not in sync with the current mapping file -

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -