ASP.NET MVC Helpers to create links with Html content (span/images)
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
MvcHtmlLink.TestApp
MvcHtmlLink
.gitattributes
.gitignore
LICENSE
MvcHtmlLink.nuspec
MvcHtmlLink.sln
README.md

README.md

MvcHtmlLink

Build status

This package adds helpers in your ASP.NET MVC views to create links containing HTML code. This can be useful to create a link on an image, or if you want to add spans or any inline html tags in the link.

Install using Nuget

To install MvcHtmlLink, run the following command in the Package Manager Console

Install-Package MvcHtmlLink

How to use

To create a link with ASP.NET MVC, you normally use the following syntax :

@Html.ActionLink("Link text", "ActionName", "ControllerName")

If you want to add html content in the link, this library gives you a new helper method. You can use it the same way you use the @Html.BeginForm

@using (Html.BeginActionLink("ActionName", "ControllerName")) {
	<img src="image.png" alt="Click here" />
}

You have 4 new helpers, to create ActionLink or RouteLink, both in Html and Ajax. They have the same overloads as the MVC helpers for classic ActionLinks and RouteLinks

Html.BeginActionLink
Html.BeginRouteLink
Ajax.BeginActionLink
Ajax.BeginRouteLink