views:

32

answers:

1

Hi guys!

I'm trying to make a little side-bar menu so people can access area of the web application.

Here is what I have so far:

<ul id="navi">
                <li><img src="../../Content/inicio.png" alt="Inicio" /></a></li>
                <li><img src="../../Content/evaluaciones.png" alt="Evaluaciones" /></a></li>
                <li><img src="../../Content/miembros.png" alt="Miembros" /></a></li>
            </ul> 

What is the MVC way of creating links?

Since this markup is on the Master Page, I'm thinking I'd need to specify the Area and also the Action to send the user to correct?

For example, I want the user to be taken to the Carreras/Index view when they click the third img, how can I do that?

+2  A: 
<%=Html.ActionLink("Action Text", "Index", "Carreras")%>

is the standard way of creating an anchor/action link. There are multiple ways to link an image ... I typically use Url.RouteUrl, but any of the methods in this post would work.

Andrew
That's for text links, I need something to route my Image. How could I use Url.RouteUrl for this?
Sergio Tapia
Sergio - see the link I provided to the other SO question. It provides a few methods (including using a background image on the ActionLink, creating a separate html helper, or using Url.RouteUrl).
Andrew