Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 31st, 2003, 08:24 AM
Registered User
 
Join Date: Jul 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Custom validation

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?
 
Old November 19th, 2003, 06:02 AM
Authorized User
 
Join Date: Nov 2003
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.

 
Old November 19th, 2003, 08:10 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

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.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Server Control....Custom Property Editor ZArrinPour ASP.NET 1.0 and 1.1 Basics 1 June 15th, 2010 11:30 AM
Custom Validation c# example dnivdniv BOOK: Beginning ASP.NET 2.0 and Databases 1 July 6th, 2008 08:13 AM
Web Service, Custom Control, Custom Return Type robzyc ASP.NET 2.0 Basics 6 June 10th, 2008 08:03 AM
Custom Validation Control Client side event rodmcleay ASP.NET 1.0 and 1.1 Basics 3 December 17th, 2004 08:47 AM
Posting form After Custom Client-side validation rathbird General .NET 3 March 4th, 2004 06:03 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.