|
Subject:
|
Custom validation
|
|
Posted By:
|
fluff
|
Post Date:
|
7/31/2003 8:24:00 AM
|
|
I am slowly picking up ASP.Net. I have found the built-in Validation controls very useful. However, I am trying to created a Custom Server control, to validate a UserID on an Admin page, which makes a trip to the server and checks if the user exists. I have managed to get this working, but for some reason, unlike the other validations I can not get this one to run when the focus has left the text box. The script will only run when the form is submitted. Does anyone know to code this?
|
|
Reply By:
|
pab006
|
Reply Date:
|
11/19/2003 5:02:30 AM
|
Why not have the form post back to itself, ie once a user ha ssubmitted the data, the code will check the database to see if the person is a valid user, if it is, the code should redirect them to which ever page comes next, if not redirect them back to the login screen, with an error message.
|
|
Reply By:
|
planoie
|
Reply Date:
|
11/19/2003 7:10:06 AM
|
Anything created in ASP.Net that needs to call a database will always only run when the form is submitted. You can't make server calls from the client that are triggered by clientside events. The only thing you can do is have the form automatically post if something happens on the client (that's the AutoPostBack property).
Peter ------------------------------------------------------ Work smarter, not harder.
|