views:

161

answers:

1

I have a very strange issue on my hands.

  • I have two IIS websites using host headers.

I have some simple code using JQuery and JQuery.forms to post a simple form to a controller. The controller returns JSON. It works great as long as the client code is present on the web site that has the controller code.

The moment I move the form over to the second IIS website and try to post to the first website where the controller is present it stops working.

Does anyone know why this might be happening? Is there some cross-domain setting I am not aware of?

Thanks

A: 

Yes there is indeed a cross domain issue. You will need to return JSONP rather than JSON. I actually blogged about this once http://stimms.blogspot.com/2009/04/aspnet-mvc-returning-jsonp.html.

stimms
Thanks. But on your blog you are doing a GET correct? You are also using JQuery's getJSON. I am using jQuery.Form and I am trying to POST. Any thoughts?
Thomas