Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET GimmeCode
if textbox is empty then error message is there,on text changed event..
i want code for that...plz help me..
Posted 5-Sep-12 5:01am
Edited 5-Sep-12 5:02am
Wes Aday90.4K
v2
Comments
Wes Aday at 5-Sep-12 11:03am
   
So you have not actually tried anything and you just want someone to write some code for you?

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

i want code for that
D'Oh! | :doh:
It does not work like this here.
 
Here is what is expected of enquirers:
1. TRY first what you want to do! You may find that it's not that hard.
2. Formulate what was done by you that looks like an issue/not working.

Try them and tell if you face issues.
Members will be more than happy to help like this.
 

 
For now, you need to:
Option #1:
Handle/Validate it on client side itself. Use RequiredFieldValidator OR define a JavaScript onsubmit event of page where you check if the textbox has value or not
 
Option #2:
After page postback, in the submit event (if a button submitted the page), look for the text value and show a message in case value is nothing.
 
I would by far suggest option 1.
Try out and post specific issues if you have any.
  Permalink  
Comments
Christian Amado at 5-Sep-12 11:14am
   
True, true :)
Member 9332883 at 5-Sep-12 15:12pm
   
i have mention that i want to validate empty texbox on textchanged event...
Sandeep Mewara at 6-Sep-12 0:59am
   
:)
 
1. If there was a text change and an event was tied up and it was raised, should not there be somehting in the textbox to raise the event?
2. What you seek is not a favored implementation in todays world where performance is key and client side validations are preferred.
3. Whatever you mentioned, I replied something. Read it again. If you have too specific an issue, share your effort made and whats troubling you.
Espen Harlinn at 6-Sep-12 10:14am
   
5'ed!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web03 | 2.8.140926.1 | Last Updated 5 Sep 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100