More safely? I see no reason why, but I would not use it in Razor. That's why:
As far as I remember, the Href function from ASP.NET 1.0 times. When creating the WebForms (!) Code, you can simply paste ~ -URL <a href="~/" runat="server">Some link</a> .
However, if you are doing ASP.NET MVC (which I assume you have been doing since using Razor), you are better off using Url.Content() , which matches the value of Url.Action() -wise.
source share