P
Prince
I'm trying to determine the the order of how controls get
validated. On a page, I have an <aspanel> with some
text controls along with submit button controls and
validation on specific textbox controls.
On the same page I have a two textbox controls so user
can enter their username and password. The two buttons
below these two controls are Login + Register.
When a user first goes to the page, the panel is
invisible (visible flag = false). If the user clicks the
Register button the panel is visible and the user can
register. All the validation controls work fine.
Problem:
If the user then realizes they have already register and
want to login, they can't.
Why:
Because once the panel is visible, all the validation
controls needs to be satisfy before the form can be
submitted.
What I want to do:
When the Login button is clicked, I want to disable all
the validation controls on the page so that the username
and password can be verified against the database.
What I tried:
I tried setting each validation control, within the
loginButton_onClick() method to false.
ex. RequiredFieldValidator1.Enabled = false;
However, it seems that the validation is occuring on the
client because the onClick method for the Login button
never fires. I set a breakpoint in VS.NET to see but it
doesn't get there.
I think the solution is to make all the validation server
side instead of client-side but I don't know how to do
that. That way, when the Login Button onClick method is
executed, I can disable all the validation controls by
setting their Enabled property to false.
I've been reading the thread, "Page Validation and Submit
Problems" but that's giving me the solution.
I hope this is clear. Does anyone has any ideas?
-- Prince
validated. On a page, I have an <aspanel> with some
text controls along with submit button controls and
validation on specific textbox controls.
On the same page I have a two textbox controls so user
can enter their username and password. The two buttons
below these two controls are Login + Register.
When a user first goes to the page, the panel is
invisible (visible flag = false). If the user clicks the
Register button the panel is visible and the user can
register. All the validation controls work fine.
Problem:
If the user then realizes they have already register and
want to login, they can't.
Why:
Because once the panel is visible, all the validation
controls needs to be satisfy before the form can be
submitted.
What I want to do:
When the Login button is clicked, I want to disable all
the validation controls on the page so that the username
and password can be verified against the database.
What I tried:
I tried setting each validation control, within the
loginButton_onClick() method to false.
ex. RequiredFieldValidator1.Enabled = false;
However, it seems that the validation is occuring on the
client because the onClick method for the Login button
never fires. I set a breakpoint in VS.NET to see but it
doesn't get there.
I think the solution is to make all the validation server
side instead of client-side but I don't know how to do
that. That way, when the Login Button onClick method is
executed, I can disable all the validation controls by
setting their Enabled property to false.
I've been reading the thread, "Page Validation and Submit
Problems" but that's giving me the solution.
I hope this is clear. Does anyone has any ideas?
-- Prince