Bruce:
I know what youre saying, but the sequence of events the way I am seeing it
should still send the collection.
1. Input made
2. Form submitted
3. Is input valid?
3a. Yes, finish processing
3b. No, Throw Exception object and give user opportunity to finish and
repost.
4. Repost form using SAME postback method
The error only occurs when I Throw an exception and attempt to reprocess the
form and I try to access values in the collection. Any other postback method
outside of that lets me access the values fine, which leads me to wonder if
on the Throw the collection is immediately cleared for some reason. My flow
of control codewise never changes - only this Throw causes the issue.
"Bruce Barker" <br******************@safeco.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Request.Form is a collection of the name/value pairs the browser sent on
the request. the only sends them when a form.submit() is done, either thru
javascript (say a asp.net control postback), or subit bullton pressed.
the browser then sends all named, and enabled <input> and <select>
controls in the form to the server as name/value pairs.
-- bruce (sqlwork.com)
"Elliot Rodriguez" <elliotrodriguezatgeemaildotcom> wrote in message
news:OK**************@tk2msftngp13.phx.gbl...I have a form that contains a mix of dynamic controls and declared
controls. All of them are intrinsic .NET controls. Several functions
within the page use Request.Form to query the value of the dynamic
controls when the page is posted back.
I also have a server side function that validates data ensuring it falls
within a given range after the post back. If the range is not valid, I am
Throw-ing a new Exception object; the validation occurs within a
Try/Catch block. The error text is written to a Label and the user is
given the opportunity to fix the value and repost the form.
When the form is reposted, the Request.Forms collection is empty and I
get "Object Reference Not Set..." errors when I try to query
Request.Form("dynamiccontrolname"). If I reload the page, the form
attempts to postback and I continue to get these errors.
Is this behavior by default? Why would Exceptions, if caught and the page
returned to the user in the same state, cause the collection to vanish?