Asp.net Cross Domain Form Posting

前端 未结 2 1584
死守一世寂寞
死守一世寂寞 2021-01-14 07:23

Is it possible to post data from an asp.net application in one domain to another application on a different domain?

I\'ve seen some of the posts where people mentio

相关标签:
2条回答
  • 2021-01-14 07:37

    If you have access to both applications then the best way is to do it server side.

    So make a web service available and consume it from the posting application.

    or

    Use httpwebrequest server side, see link below.

    http://www.netomatix.com/httppostdata.aspx

    On the client you could use a library such as http://easyxdm.net/wp/ - though there is a bit of a learning curve.

    Here are a couple of links that may help you if you dont want to use the above routes and are prepared to edit your asp.net pages.

    http://blog.dmbcllc.com/2009/11/11/asp-net-cross-domain-form-submission/

    Cross-Domain Posting in ASP.Net loses Form Fields

    0 讨论(0)
  • 2021-01-14 07:48

    It's absolutely possible, and pretty easy to do.

    1. Browser posts data to your .net app
    2. Your app uses the HttpWebRequest object to post data to the 3rd party site
    3. 3rd party site gives data back to your app or simply accepts post.
    4. Your app responds to the browser with whatever you need.

    I have no idea why you would "inject forms into the response stream" or do anything funky like that. Perhaps you could add a bit more about your requirements.

    Chris.

    0 讨论(0)
提交回复
热议问题