本文介绍了C#:获取从表单发布的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用带有方法post的表单从另一个页面发布一些数据.我想知道的是:什么是获得价值的最佳方法.以eacn名称的形式显示为
Im posting some data from another page using a form with the method post. What i would like to know is: Whats the best way to get the values. Going by eacn name in the form as
Request["name"]或者有什么方法可以收集数据并通过它进行发送?谢谢
Or is there any way to get a collection of the data and itterate through it? Thanks
推荐答案您可以使用 Request.Form ,其中Form属性是表单值的集合:
You can use Request.Form, where the Form property is a collection of the form values:
foreach (var key in myCol.AllKeys) { Response.Write(Request.Form[key]); }更多推荐
C#:获取从表单发布的值
发布评论