Tuesday, November 19, 2013

How to set base URL in ASP.NET MVC for JavaScript?

In _Layout.cshtml, Add base tag in head, and pass base URL.

<head>
    <base href='@string.Format("{0}://{1}{2}", Request.Url.Scheme, Request.Url.Authority, Url.Content("~"))'/>
</head>

1 comment:

  1. This is an amazing blog,it gives very helpful messages to us.Besides that Wisen has established as Best Dot Net Training in Chennai. or learn thru ASP.NET Online Training . Nowadays Dot Net has tons of job opportunities on various vertical industry.

    ReplyDelete