Request.Form的有关问题
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() == " ")
用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() == " ")