How to use ASP.Net as a client for Ajax?

  • Thread starter Thread starter Avery D
  • Start date Start date
A

Avery D

Guest
I am starting on a project that uses ASP.NET 3.5 and jQuery. The client HTML page makes an asynchronous call using jQuery to a url on another domain to get some text from ASP.NET. I'm not sure where to begin. The examples I find show how to use .NET controls for callbacks, but the client will be an HTML page on another domain.

I have tested by using a web project in ASP.NET:

protected void Page_Load(object sender, EventArgs e)
{
MyClass myClass = new MyClass();
Response.Write(myClass.GetData(Request["a"], Request["b"]));
}

This doesn't work across domains. Firefox shows this error: Access to restricted URI denied (NS_ERROR_DOM_BAD_URI)

I doubt my approach is correct. I've found lots of examples that 2) tell me how to write the client in javascript and 2) how to use an aspx page and code behind.

I'd very much appreciate it if someone can point me in the right direction. Examples, links, etc. are more than welcome.
 
Back
Top