HttpWebResponse Post 前端控件数据,后台如何接收?
MVC视图页:
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<title>test</title>
<script src="/Content/js/jquery-1.10.2.min.js?v=2018071901" type="text/javascript"></script>
</head>
<body>
<form id="frSubmitOrder" action="" method="post">
<input id="O_LeagueID" name="O_LeagueID" type="hidden" value="" />
<input id="O_Product_ID" name="O_Product_ID" type="hidden" value="" />
<input id="O_HotelID" name="O_HotelID" type="hidden" value="" />
<input id="O_RoomTypeID" name="O_RoomTypeID" type="hidden" value="" />
<input id="O_RoomID" name="O_RoomID" type="hidden" value="" />
<input id="appid" name="appid" type="hidden" value="" />
<input id="ctoken" name="ctoken" type="hidden" value="" />
<div class="submit-order-btn clickable red-btn color3" data-name="预订-提交订单">
提交订单
</div>
</form>
<script type="text/javascript">
$(function () {
//搜索 点击搜索
$(".submit-order-btn").click(function () {
$('#frSubmitOrder').submit();
});
});
</script>
</body>
</html>
mvc控制器:
[HttpPost]
public ActionResult test(string id)
{
Dictionary<string, string> dict = new Dictionary<string, string>();
dict.Add("action", "Add");
//Response.Write("<li>" + Request.Params.Keys[i].ToString() + " = " + Request.Params[i].ToString());
for (int i = ; i < Request.Form.Count; i++)
{
dict.Add(Request.Form.Keys[i].ToString(), Request.Form[i].ToString());
}
return Json(Post("http://localhost:57239/Ajax/Order.ashx", dict), JsonRequestBehavior.AllowGet);
}
Order.ashx 接收post 来的数据:
string _action = context.Request["action"];
string appid = context.Request["appid"]; if (context.Request.RequestType == "POST")
{
//接收并读取POST过来的XML文件流
StreamReader reader = new StreamReader(context.Request.InputStream);
String xmlData = reader.ReadToEnd();
}
HttpWebResponse Post 前端控件数据,后台如何接收?的更多相关文章
- ASP.NET开发中主要的字符验证方法-JS验证、正则表达式、验证控件、后台验证
ASP.NET开发中主要的字符验证方法-JS验证.正则表达式.验证控件.后台验证 2012年03月19日 星期一 下午 8:53 在ASP.NET开发中主要的验证方法收藏 <1>使用JS验 ...
- 快如闪电,触控优先。新一代的纯前端控件集 WijmoJS发布新版本了
全球最大的控件提供商葡萄城宣布,新一代纯前端控件 WijmoJS 发布2018 v1 版本,进一步增强产品功能,并支持在 Npm 上的安装和发布,极大的提升了产品的易用性. WijmoJS 是用 Ty ...
- Ext.net控件调整后台事件、方法论
一.以ext.net的button为例调用后台事件: 前台代码: <ext:Button ID="Button1" runat="server" Text ...
- 动态合并Repeater控件数据列
前天Insus.NET实现<动态合并GridView数据行DataRow的列>.今天再玩玩Repeater控件,功能也是动态合并某列栏位.Repeater控件跟GridView控件一样集成 ...
- Silverlight Visifire控件 .net后台控制aspx页面控件的显示与隐藏,动态给控件赋值,选定默认值的设定
.net后台代码: 控件的显示与隐藏: this.dateStart.Visibility = Visibility.Collapsed;//不显示控件 this.dateYear.Visibilit ...
- ASP.NET中多个相同name的控件在后台正确取值
有兽, 页面上可能有多个相同name的Html表单控件, 一般在后台使用Request.Form[“name”]取值,并用‘,’分隔. 但是当值中包含逗号时, 取值就会出现异常, ...
- MFC 操作控件数据
在MFC中有多种获取控件数据的方法 1.GetWindowText()和SetWindowText()函数 ],ch2[],ch3[]; GetDlgItem(IDC_EDIT1)->Get ...
- asp.net无法触发asp控件的后台方法
前台代码: <asp:Button ID="btnFinish" runat="server" Text="完成" Font-Size ...
- 在tableviewcell里面嵌入switch控件以及如何获取switch控件数据
主要是通过cell.accessoryView来添加switch控件- (UITableViewCell *)tableView:(UITableView *)tableView cellForRow ...
随机推荐
- python "import this"
The Zen of Python, by Tim Peters Beautiful is better than ugly.Explicit is better than implicit.Simp ...
- Eclipse如何新建TOMCAT并配置Server Locations和Publishing属性
Eclipse如何新建TOMCAT并配置Server Locations和Publishing属性 2018年05月08日 23:10:33 ACGkaka_ 阅读数:1269 一.建立TOMCA ...
- C语言关键字分类整理
C语言总览: 强类型,面向过程 简洁.灵活:32个关键字(C99标准新增5个,C11新增7个),9种控制语句,34种运算符 数据类型丰富,运算符丰富 结构化(控制语句).模块化(函数) 灵魂.特色:指 ...
- 关于cordova+vue打包apk文件无法访问数据接口
作为一个cordova小白,我按照官方文档和网上资料完成了讲vue文件打包到cordova中并打包成apk文件,完成了一个简单app的制作,当我正陶醉于可以自己完成一个app的时候突然发现,我的app ...
- python—文件创建
# 1.文件操作# day1.txt# 1.文件路径:E:\day1.txt# 2.编码方式:utf-8.gbk# 3.操作方式:只读,只写,追加,读写,写读# 以什么编码方式储存的方式储存就以什么编 ...
- npm ERR! Unexpected end of JSON input while parsing near...错误
问题解决方案在GitHub中: https://github.com/vuejs-templates/webpack/issues/990 总结一下:1.删除package-lock.json 2.进 ...
- 10/03/2019 PCL-1.8.1 Ubuntu 16.04 boost 1.69 CUDA 9.0 installation
cmake -DCMAKE_BUILD_TYPE=None -DBUILD_GPU=ON -DBUILD_CUDA=ON -DBUILD_gpu_kinfu=ON -DBUILD_gpu_kinfu_ ...
- Angular/cli 安装(windows环境)。
1.卸载先前安装的Angular/cli npm uninstall -g angular-clinpm uninstall --save-dev angular-clinpm uninstall - ...
- ejabberd之开题篇
ejabberd是基于Jabber/XMPP协议的即时通讯服务器.采用Erlang/OTP开发.它的特点是,跨平台,容错,集群和模块化. 因为自己本身是基于erlang工作,而且听到有不少的公 ...
- 对C语言指针的理解
一个小程序引发对于C语言指针的思考: #include <bits/stdc++.h> using namespace std; void my_swap (int* a,int* b) ...