[RESOLVED]Href helper must?

using href helper is a must? because both the urls are resolving.. so why user href?

<a href="~/Account/Home">Home</a>

<a href="@Href("~/Account/Home")">Home</a>

both resolve to same location

The Href helper was introduced in Web Pages 1. In version 2, the Razor parser was changed so that all you needed to use is the tilde ~ and internally, the Href method is invoked to generate the URL. That means you do not need to use Href if you are working
with version 2 of Web Pages (or higher).

Thankyou for the clarification!

Leave a Reply