先贴我的html代码 <input name="txtPrice_212" type="text" />
<input name="txtPrice_213" type="text" />
<input name="txtPrice_214" type="text" />
<input name="test" type="text" />
我post提交后,到后台,想获取以"txtPrice_"开头的表单,请问我后台代码要怎么写。
我知道可以通过正则表达式来获取,不过我不懂正则表达式.请教各位大大
<input name="txtPrice_213" type="text" />
<input name="txtPrice_214" type="text" />
<input name="test" type="text" />
我post提交后,到后台,想获取以"txtPrice_"开头的表单,请问我后台代码要怎么写。
我知道可以通过正则表达式来获取,不过我不懂正则表达式.请教各位大大
后台可以得到的不是前台的参数或session么?怎么会有前台把网页源码提交给服务器的?如果单纯文本中获取,(?is)<input[^>]+?name="txtPrice_[^>]+>可以得到你要的<input标签
我是想通过Request.Form[".."]这种类型的获取
Pattern p = Pattern.compile("^txtPrice_.*$");
if(p.matcher(paramName).matches()) {
// ...
}
改为
Pattern p = Pattern.compile("^txtPrice_\\w*$");
规范些
for(int i = 0;i<Request.Form.Count;i++)Response.Write("<li>" + Request.Form.Keys[i].ToString() + " = " + Request.Form[i].ToString());