Why should I use @Url.Content(“~/blah-blah-blah”)?

Usually, your web application is published as: www.yoursite.com/. The ~ character matches the root of the site, /.

However, if you publish your site withing a virtual directory www.yoursite.com/mywebapp/, then the ~ character would match /mywebapp/.
Hard-coding URLs with the “/” character would cause incorrect page references.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)