Where I can get the trace.axd ?
And also, the exception thrown from code lied in section
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 )
the null pointer exception seem to point to variable key. That's why I asked
would it possible the key would be a null value ? Thx
"Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
wrote in message news:OL**************@TK2MSFTNGP10.phx.gbl...
Look at the trace.axd to get more information and you will probably see
what's going wrong.
It is also possible that one of the key don't have an associated value.
This happens frequently with the QueryString information. You should
store the value of request.Form.GetValues(key) as an object and make that
it's not null before using it.
S. L.
"Tony Cheng" <sd***@fdfsds.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl... 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.F orm.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