Results 1 to 2 of 2

Thread: How to use Character

  1. #1
    Davismoore is offline Senior Member
    Join Date
    Dec 2009
    Posts
    284
    Rep Power
    3

    Default How to use Character

    How to use Character counter in ASP.Net?

    I am working on one live project where I am using Asp.net as front end. I have created one text box whose maximum length is 500. I use regular expression for validation if lengths of character in text bow go over 500. But it is very lengthy process. I would like to show a counter whose value is decremented from 500 whenever key press event occurred on text box.

  2. #2
    JacksonPerez is offline Banned
    Join Date
    Dec 2009
    Posts
    274
    Rep Power
    0

    Default

    You have to use label with width correctly set to display a lesser space besides the textbox. After doing this allocate the text of the label with the length of the textbox length as follows:

    key press event
    {
    l1.Text = TextB1.Text.Length;
    or
    l1.Text = (500 - Convert.ToInt32(TextB1.Text.Length)).ToString();
    }

Similar Threads

  1. Character
    By arsenal in forum Everything Else
    Replies: 0
    Last Post: 03-20-2009, 05:31 AM
  2. Optical Character Recognition
    By ponting77 in forum Programming
    Replies: 0
    Last Post: 01-27-2009, 06:14 AM
  3. Printer Forming a Character
    By Jacory666 in forum Printer
    Replies: 0
    Last Post: 12-05-2008, 06:35 AM
  4. Null character
    By techno23 in forum Programming
    Replies: 0
    Last Post: 03-26-2008, 12:02 PM
  5. Character
    By techno23 in forum Programming
    Replies: 0
    Last Post: 03-26-2008, 11:10 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
SEO by SubmitEdge

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48