Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>When the pseudo-URL passed to an HTTP request begins with a slash (e.g. "/path/to/resource"), the pseudo-URL is "completed" by treating it as if the given path were under the Web site's root directory (e.g. "http://my.site/path/to/directory").</p> <p>Clearly, you were expecting the pseudo-URL to be processed as if the given path were under your Web application's root directory. Well, I have bad news for you: The HTTP protocol does not deal with such a thing as a "Web application".</p> <p>The ASP.NET MVC Framework provides the <code>Url.Content</code> function, which takes pseudo-URLs beginning with a tilde character (e.g., "~/path/to/resource") and returns the result of replacing the tilde character with the Web application's root directory (e.g., "http://my.site/an/application/path/to/resource", assuming the Web application's root directory is "http:/my.site/an/application"). However, the ASP.NET MVC Framework is only available on the server side. If your JavaScript runs on the client side, it cannot call <code>Url.Content</code>.</p> <p>But not all is lost. The ASP.NET MVC Framework <a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.controller.javascript.aspx" rel="nofollow">allows you to dynamically generate JavaScript code on the server and run it on the client</a>, the same way it <a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.controller.view.aspx" rel="nofollow">allows you to dynamically generate HTML content and of course send it to the client</a>. That way, you can expand the pseudo-URLs into actual URLs <em>on the server side</em>, and deploy the resulting JavaScript code to the client.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload