问题描述
我正在尝试创建一个静态 HTML 页面,该页面具有一个 ,该页面发布到 3rd-party ASP.NET 网站.
I am trying to create a static HTML page which has a <form>
which posts to a 3rd-party ASP.NET website.
当目标网站使用 ASP.NET webforms 时,这可能吗?
Is this possible when the target website uses ASP.NET webforms?
推荐答案
这绝对有可能.您可以在任何地方向任何网站发布 POST.(在设计接受来自网络商家(例如 PayPal)的 POST 的应用程序时,请记住这一点;-) 确保您知道 POST 来自何处.)
This is absolutely possible. You can issue a POST to any website, anywhere. (Keep this in mind when you're designing an application that accepts POSTs from a web merchant such as PayPal ;-) make sure you know where the POST is coming from.)
网站是否会接受您的请求,当然取决于服务器端代码的编程方式.如果您正在向 ASP.NET WebForms 应用程序发送 POST 请求,并且该应用程序并非设计为接受第三方 POST,那么您将很难让 POST 参数看起来像是来自 WebForms 页面.例如,网站将寻找加密的视图状态等.
Whether or not the website will accept your request, of course, is up to however the server-side code was programmed. If you're POSTing to an ASP.NET WebForms app and the app wasn't designed to accept third-party POSTs, then you're going to have a hard time making your POST parameters look like they came fro ma WebForms page. For example, the website will be looking for the encrypted viewstate, among other things.
您可以使用 firebug 或其他一些工具从 webforms 应用程序中嗅探 POST 数据,然后将该数据复制到您的静态 HTML 页面中......它可能会起作用.
You could use firebug or some other tool to sniff the POST data from the webforms app, and then replicate that data in your static HTML page .... it might work.
您是否对 ASP.NET Webforms 应用程序有任何编程控制权?
Do you have any programming control over the ASP.NET Webforms app at all?
这篇关于是否可以从静态 HTML 表单对 ASP.NET 执行跨页 POST?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!