Click here to Skip to main content
11,415,000 members (66,084 online)
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 6:01am
Edited 5-Sep-12 6:02am
Wes Aday94.3K
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)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 9,160
1 OriginalGriff 7,487
2 Maciej Los 3,710
3 Abhinav S 3,298
4 Peter Leow 3,084


Advertise | Privacy | Mobile
Web04 | 2.8.150427.4 | Last Updated 5 Sep 2012
Copyright © CodeProject, 1999-2015
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