Click here to Skip to main content
11,577,710 members (62,057 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 5:01am
Edited 5-Sep-12 5:02am
Wes Aday98.1K
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 Peter Leow 180
1 Richard MacCutchan 175
2 DamithSL 150
3 OriginalGriff 135
4 Afzaal Ahmad Zeeshan 95
0 OriginalGriff 830
1 Sergey Alexandrovich Kryukov 701
2 Abhinav S 573
3 F-ES Sitecore 420
4 Dave Kreskowiak 374


Advertise | Privacy | Mobile
Web03 | 2.8.150603.1 | 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