T
Tony Cheng
for (int i=0; i<_request.Form.Count; i++ )
{
string key = _request.Form.GetKey(i);
if ( !key.Equals("formCode")
&& !key.Equals("formLanguage")
&& !key.Equals("__VIEWSTATE")
&& !key.Equals("__EVENTARGUMENT")
&& !key.Equals("__EVENTTARGET")
&& key.IndexOf("sendButton")<0
&& key.IndexOf("clearButton")<0
&& key.IndexOf("HeaderControl")<0
&& key.IndexOf("PostingListControl")<0 )
{
formVO.addFormData(key,
StringUtil.extractStringFromStringArray(_request.Form.GetValues(key)));
}
}
here is a part of my code. After several postback due to invalid validation,
null pointer exception is caught. What I wonder is request.Form.Count means
number of name-value pairs in Form collection. Then variable i would be
within the range of count. The null pointer exception seem to point to the
variable key. Is that possible a name-value pair can contain a null as key ?
Thx
{
string key = _request.Form.GetKey(i);
if ( !key.Equals("formCode")
&& !key.Equals("formLanguage")
&& !key.Equals("__VIEWSTATE")
&& !key.Equals("__EVENTARGUMENT")
&& !key.Equals("__EVENTTARGET")
&& key.IndexOf("sendButton")<0
&& key.IndexOf("clearButton")<0
&& key.IndexOf("HeaderControl")<0
&& key.IndexOf("PostingListControl")<0 )
{
formVO.addFormData(key,
StringUtil.extractStringFromStringArray(_request.Form.GetValues(key)));
}
}
here is a part of my code. After several postback due to invalid validation,
null pointer exception is caught. What I wonder is request.Form.Count means
number of name-value pairs in Form collection. Then variable i would be
within the range of count. The null pointer exception seem to point to the
variable key. Is that possible a name-value pair can contain a null as key ?
Thx