Request.Params 和 Request.Form 什么时候不同? [英] When do Request.Params and Request.Form differ?

查看:29
本文介绍了Request.Params 和 Request.Form 什么时候不同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近遇到了一个问题,如果使用 Request.Form 访问,则值为 null,但如果使用 Request.Params 检索则很好.这些方法之间有什么区别可能会导致这种情况?

I recently encountered a problem where a value was null if accessed with Request.Form but fine if retrieved with Request.Params. What are the differences between these methods that could cause this?

推荐答案

Request.Form 只包含通过表单发布的变量,而 Request.Params 包含发布的表单变量和指定为 URL 参数的 get 变量.

Request.Form only includes variables posted through a form, while Request.Params includes both posted form variables and get variables specified as URL parameters.

这篇关于Request.Params 和 Request.Form 什么时候不同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆