views:

231

answers:

1

I've got this app where I'm using an IHttpHandler to serve JSON data to my JavaScript method.

  var theUrl = location.href;
  var txtCity = '#<%= txtForSaleCity.ClientID %>';
  var hidCity = '#<%= hiddenForSaleCityID.ClientID %>';
  var theSource = '<%= Page.ResolveUrl("~/RegionsAutoComplete.axd")%>?PID=<%= hiddenBusinessProvince.value %>';

This works fine on my "localhost" webserver, but I've also got a staging server for my clients to use. http://staging.infinitas.ws/ClientSite/

The problem that I'm having is that when the app is hosted on the staging server, the theSource is mapped incorrectly (contains /ClientSite/). I could do something like a String.Replace but I'm looking for a more elegant way of achieving this.

+1  A: 

try

Page.ResolveClientUrl("~/RegionsAutoComplete.axd")
runxc1 Bret Ferrier
That was easy!!
rockinthesixstring