Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Validating entry in a textbox
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
ASP.NET
Database:
Visual FoxPro
Divers
Thread ID:
01026847
Message ID:
01035690
Vues:
15
>Dmitry;
>
>Have you found a solution to the problem? There is an example of something similar on page 218-226 of the O'Reilly ASP.NET Cookbook that might be of help.
>
>Tom

Tom,

Sorry for the delay in replying to your message, I was on vacation last week, away from UT. First, I don't have the book you mentioned so I can't see what they have as a solution.

However, the solution to my problem ended up being the following:

Since the _TextChanged() method does not return true or false and it does not stop the process of the page, I had to create a property to set On/Off.
private bool EquipmentVerified
{
   get
   {
      object o = ViewState["EquipmentVerified"];
      if ( o == null )
         return false;
      return ( bool ) o;
   }
   set { ViewState["EquipmentVerified"] = value; }
}

// In the TextChanged event set this bool.

txtEquipment_TextChanged
{
   EquipmentVerified = //whether or not it is verified.
}

// In the button click, check this bool
btnSubmit_Click
if ( EquipmentVerified )
{
   //the value is valid.
   //run insert or whatever.
}
The above solution (which I got on ASP.NET) works very well.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform