Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

ValidationControll to check if value excists in database???

 

Hi.

 

I have form that you use to signup on my page.

 

Is there any way to use a valitaor control to check for a value in a database? There is a CompareValidator but I cant get it to check if a value excists in a database. The value I want to check is if the username that is used on the regform already excists in the database.

 

Is it possible?

 

//Andi

Edited by Andi03
  • Administrators
Posted

On the toolbox amongst the other validator controls there is one called CustomValidator

 

Add it to the page like any other validator and set the ControlToValidate Property to the control you want to validate.

Double click the control and it should open the code behind in an event calle something like ServerValidate - put the validation logic in here.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted
Lets say I have made a Function that returns the value True or False. How would the Validation control know when to display the message (The username already excists)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...