Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
210
Relative url data source when using <base>
posted

I use a <base href="@Url.Content("~")"> element in my pages so that I can reference URLs from JavaScript and they will still work even when the web app is installed in an IIS virtual directory, etc. vFor example I often using URLs like $.get('api/something/something'); and because of the <base> element it prefixes that value onto the .get requests that I make.

The problem is when using a relative url with the grid it does not work. I get the error: "Uncaught Error: Syntax error, unrecognized expression: #api/Policy/GetContracts"

What's the solution here and what are your recommendations?

Parents Reply Children