How to use Server.MapPath in jQuery JavaScript when deploying on Hosting Server
<p>I am using <code>WebMethod</code> on my ASPXpage and I call it from jQuery on the same page like this:</p>

<pre><code>    $.ajax({
                type: "POST",
                url: "Mypage.aspx/GetSomeData",
                contentType: "application/json; charset=utf-8",
                data: parameters,
                dataType: "json",
                success: AjaxSucceeded,
                error: AjaxFailed
            });
</code></pre>

<p>This works fine in my debug environment, but when I deploy on the hosting site it does not.
The problem seems to be in the URL because on the server the path would be different. So I  used <code>Server.MapPath</code> in various ways but none of them worked.</p>

<p>E.g  </p>

<pre><code>url: '&lt;%= Server.MapPath("MyPage.aspx/GetSomeData")%&gt;',
</code></pre>

<p>When I use the above code snippet it does not work on my machine. <code>MyPage</code> is in the root directory.</p>
