0

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
  • Note, I'm not using MVC on this project so those helpers won't help me here. Commented Jun 21, 2010 at 20:58

1 Answer 1

1

try

Page.ResolveClientUrl("~/RegionsAutoComplete.axd")
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.