Hi Robert,
>> At the start of a NetWebForm, I wish to evaluate a function and based on the result continue with the NetWebForm or jump to another form.
this is a common thought pattern, especially coming from windows, but it's very difficult to pull off. That's because the form procedure is called over and over again in small little bites. It's not like a windows form where it comes in once at the top and is easily changed.
Looking at your example;
the code at the top of FormA is very wrong. If you put a trace in here you'll see lots of calls coming in - the p_stage parameter being different each time.
But worse, the call here to _sendfile is also not going to work. This is an architecture thing, but boils down to the _sendfile begin called twice - once for the original form, then you recurse in to it with your call - hence the two headers.
So let's ack up a bit and consider two other ways to attack the problem.
a) The URL that comes to this form in the first place should probably be set correctly - ie make the decision at generate time, not click-time.
b) failing that, make this form (form A) capable of handling multiple cases - perhaps by hiding/unhiding tabs etc. Thus one form, which looks different, but is at heart the same form procedure. or
c) if that's not a possibility then move the "business logic" into the WebHandler completely, so FormA is not called in the first place, it goes straight to Form2.htm.
It's not really possible to say which is best in your case, without understanding a bit more about the context of the decision.
cheers
Bruce