asp.net mvc - @Url.Content isn't found in my javascript file -


i have next line in javascript file:

"<img alt=\"active\" src=\"@url.content(\"~/images/play.png\")\" />" 

so tried ahm suggested in topic (@url.content in separate javascript file using aspnet mvc 3 , razor):

var root = "@url.content(\"~/"; "<img alt=\"active\" src=\"" + root + "images/play.png\")\" />" 

but got error:

reports/@url.content( 404 (not found)  

what did wrong?

any appreciated!

@url.content not supported in javascript file

in code wrong

var root = "@url.content(\"~/"; <= parentheses not closed & donot need escape quotes 

instead use in beginning of file

var root = '@url.content("~/")'; 

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -