J
jeeji
Hi
I have a web application that has a main page in which the user inputs
some data in some input fields.
The page contains two buttons (Button1 and Button2) that do a
postback.
When Button1 is clicked I want to call a function called Validate1(),
and when Button2 is clicked I want to call Validate2(). Those
functions validate the data input in the input fields.
If data is not valid I want to mark the input field that caused the
datavalidation error.
What is the best practice way of doing this.
My problem is that when a button is clicked, page_load() is called
first, followed by the button click event handler.
I cannot put the calls to Validate1() or Validate2() in page_load,
because I cannot see which button was clicked.
But then, page_load typically draws the page to be rendered. But in
order to render the page, I have to know which input field caused the
validation error.
I would assume this is a typical scenario, which I cannot seem to
figure out.
Thanks in advance
Jeeji
I have a web application that has a main page in which the user inputs
some data in some input fields.
The page contains two buttons (Button1 and Button2) that do a
postback.
When Button1 is clicked I want to call a function called Validate1(),
and when Button2 is clicked I want to call Validate2(). Those
functions validate the data input in the input fields.
If data is not valid I want to mark the input field that caused the
datavalidation error.
What is the best practice way of doing this.
My problem is that when a button is clicked, page_load() is called
first, followed by the button click event handler.
I cannot put the calls to Validate1() or Validate2() in page_load,
because I cannot see which button was clicked.
But then, page_load typically draws the page to be rendered. But in
order to render the page, I have to know which input field caused the
validation error.
I would assume this is a typical scenario, which I cannot seem to
figure out.
Thanks in advance
Jeeji