读书人

Request.Form的有关问题

发布时间: 2012-01-28 22:06:14 作者: rapoo

Request.Form的问题
用Request.Form接收一个不存在的表单,如何防止出错,
是用if (Request.Form[ 'nothing '] == null)来判断,或者有其它通用的方法或函数呢

[解决办法]
if(Request.Form[ 'nothing '] != null && Request.Form[ 'nothing '].Trim() != " ")
or
if(null == Request.Form[ 'nothing '] || Request.Form[ 'nothing '].Trim() == " ")

读书人网 >C#

热点推荐