Reputation: 8359
I am using MVC.
I have this line in my html:
<div id="logo"><a href="#"><img src="../../Content/img/logo3.png" alt="" /></a></div
But I want to redirect to another view when a user click on the logo.
How can I do that? I need the same structure.
Thanks in advance
Upvotes: 0
Views: 13024
Reputation: 3061
<a href="<%: Url.Content("~/Controllor/View") %>">
<div id="logo">
</div>
</a>
Upvotes: 0
Reputation: 1039150
Give your anchor an href
value pointing to the controller action that you want to redirect to:
<div id="logo">
<a href="@Url.Action("someaction", "somecontroller")">
<img src="../../Content/img/logo3.png" alt="" />
</a>
</div>
Upvotes: 12