Jazz wrote:
Paul,
What I want is to detect if it's from ButtonA click in the Form_Load
even(this is before the ButtonCLick event gets called), and if it is I will
skip some code in the Form_Load .
Thanks,
Jazz
In VB:
If Not Request.Params("ButtonA") is Nothing Then
'Do stuff if button A was pressed
Else
'Do stuff if button A wasn't pressed
End If
However, I wouldn't recommend it. You've now, potentially, got two
places where code reacts to button presses - in the Page Load event and
in the button Click event. A future maintainer (or a future you) may be
confused if they don't spot the code in Page Load, and spend valuable
time trying to diagnose why the page acts differently when the button
is pressed.
Perhaps if you could elaborate on what behaviour you're altering, we
could suggest some viable alternatives?
Damien