Join Dotnetcodes is online Discussion Forum for Software professionals . It lets you find friends around the world and Create professional network that share similar interests as you. Get help on ur projects by industry specialists. Also get answers to all ur technical/placement related querries.Get an edge over others.
Already MemberClick here to login MVC Interview Questions Answers Interview Questions
Serial Number in SSRS Articles
Get Started Developing for Android Apps with Eclipse Articles
How to Print a Crystal Report direct to printer Articles
Razor View Engine Interview Questions Answers Interview Questions
.Net framework 4.0 Interview Questions Answers Interview Questions
SQL server reporting services Interview Questions (SSRS) part 1 Articles
Whats New in ASP.NET 4.0 Part 2 Articles
Difference between Encapsulation and Abstraction Interview Questions
Explaining SDLC -System Development Life Cycle Articles
SPIRE PDF Library Articles
Infosys Interview Questions Interview Questions
Html5 interview questions and answers Interview Questions
Dynamic Menu using HTML List Tag and CSS in ASP.Net Articles
SharePoint 2010 interview Questions Answers Interview Questions
Submit Articles | More Articles..

How To Decrease Value in Label When enter data in textbox

Posted By: Atul19 On:10/15/2010 1:01:53 PM in:Source Codes Category:ASP.NET Hits:1671
Here U Find how to decrease value of label when we enter a data in textbox

 Decrease value of label when we enter a data in textbox

Space for Article Introduction

Paragraph Title 1

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class HelpDesk : System.Web.UI.Page
    private const int Max_Length =10;

    protected void Page_Load(object sender, EventArgs e)
       // Label5.Text = Convert.ToString(Convert.ToInt16(TextBox2.Text.Length) - 1);
        Label5.Text = string.Format("{0} Characters Remains",Max_Length);
        TextBox2.MaxLength = Max_Length;

    protected void TextBox2_TextChanged(object sender, EventArgs e)
        Label5.Text = string.Format("{0} Characters Remains",Max_Length-TextBox2.Text.Length);
        //if (TextBox2.Text == "")
        //    Label5.Text = "10 Characters Remains ";

        //if (TextBox2.Text.Length<10)
        //    Response.Write("Character Length Exists");

        //string backspace = TextBox2.Text.Trim();
        //if (backspace.Length > 1)
        //    TextBox2.Text = backspace.Substring(0, backspace.Length - 1);

        //    Label5.Text = "10 Charaters";


    protected void Button1_Click(object sender, EventArgs e)


Paragraph Title 2

Space for Paragraph contents


Space for Conclusion
comments powered by Disqus
User Profile
Web Developer
?????? , India
Email :You must Log In to access the contact details.
Latest Post from :Atul19
Bank Application
View: 6501 | Submitted on: 11/22/2010 7:54:37 AM
How To Decrease Value in Label When enter data in textbox
View: 1671 | Submitted on: 10/15/2010 1:01:53 PM 2.0 interview question and anserws
View: 1812 | Submitted on: 10/15/2010 12:57:09 PM
Submit Articles | All Post of This User..

Advertise About Us Private Policy Terms of use
All rights reserved to dotnetcodes. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks.
Best viewed at 1024 x 768 resolution with Internet Explorer 5.0 or Mozila Firefox 3.5 or Google Crome and higher