asp.net - 为什么我的 XML 不使用表单操作 URL 重定向?
问题描述
我希望我的页面将重定向到表单的 action 属性中的 url。但事实并非如此,它只是继续响应。在我的页面上写下 \n 和 \t。我的身体 onload 上有 AutoSubmit 功能。
Dim xhtmlstr As String
xhtmlstr = "<?xml version='1.0' encoding='UTF-8'?>"
xhtmlstr += "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>"
xhtmlstr += "<html xmlns='http://www.w3.org/1999/xhtml'>\n"
xhtmlstr += "<head>\n"
xhtmlstr += "\t<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'/>\n"
xhtmlstr += "<title>Sending request....</title>\n"
xhtmlstr += "<script type='text/javascript' language='JavaScript'>"
xhtmlstr += "window.history.forward(-1);"
xhtmlstr += "function AutoSubmitForm() {"
xhtmlstr += "document.collect.submit();"
xhtmlstr += "}\n"
xhtmlstr += "</script>\n"
xhtmlstr += "</head>\n"
xhtmlstr += "<body onload='AutoSubmitForm()'>\n"
xhtmlstr += "<form name='collect' id='collect' action='https://myURL.net/payment/Default.aspx' method='POST'>\n"
xhtmlstr += "\t<input type='hidden' name='paymentrequest' value='" + createRequest() + "'/>\n"
xhtmlstr += "</form>\n"
xhtmlstr += "</body>\n"
xhtmlstr += "</html>"
Response.ContentType = "text/xml"
Response.Charset = "UTF-8"
Response.Clear()
Response.Write(xhtmlstr)
Response.End()
解决方案
推荐阅读
- flutter - Flutter Webrtc - 3 对等连接
- ios - UICollectionView:将一个单元格拖动/移动到另一个单元格上(无重新排序)
- image-processing - 维纳滤波器的参数估计
- javascript - 多输入 onChange 问题
- oracle - 如何使用 Azure Active Directory 登录自动创建 Oracle Apex 用户?
- amazon-web-services - 更新 Elastic Beanstalk 上已弃用的 php 平台
- sql - 更新/插入在 postgres 触发器功能中不起作用
- python - 下载 xml 文件并将其保存到文本文件中
- python - 将 0001 年 1 月 1 日转换为时间库的时间戳
- nsis - 如何从 NSIS 中的 RCData 资源中读取字符串