Image Hyperlink in ASP.NET - MVC 4 -


i try create project first time in asp.net (mvc4).

and try create image hyperlink go index page.

i have search lot of things , shows simple that.

but can´t understand why doesn´t work me.

someone can give hand?

code:

<a href="<%= url.action("index","home")%><img src="~/content/imagens/nav-arrow-back.png"/></a>  

the action "index" in controller calls home.

first up, noted you're missing closing quote on href. second, mvc 4 doesn't use <% %> syntax, @ least not default; should using razor v2 uses @, code should this:

<a href="@url.action("index","home")"><img src="~/content/imagens/nav-arrow-back.png"/></a> 

if use old syntax assume try handle actual text <%= url.action("index","home")%> url, won't work.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -