Wednesday, 16 November 2016

remaining characters counter javascript


remaining characters counter javascript

Introduction:

Here I will explain remaining characters counter javascript or count number of characters in textbox javascript. Some times show the character counter to remaining for textbox or textarea at client side. For this we need to use onkeyup event of textbox or textarea.

In previous post I explained System.Array' does not contain a definition for 'Count' how to access session in class c# how to create chat application in asp.net using c# sql query to get daily count and many article about Asp.net javascript and C#

javascript character count textarea
count number of characters in textbox javascript
textbox character counter jquery
textarea character count jquery
javascript character countdown
validate number of characters in textbox javascript
jquery character countdown
textbox character counter in asp.net c#

Eample:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
<html>
 <head>
    <title>remaining characters counter javascript</title>
    <script type="text/javascript">
  function Counter() {
  var i = document.getElementById("txtMessage").value.length;
  document.getElementById("lblCounter").innerHTML = 10 - i;
    }
     </script>
    </head>
<body>
 <h1> Show Number of Characters Remaining in Textbox or Textarea  </h1>
 example of remaining characters counter javascript
 <br><br>
 Enter Name(max length:10): <input id='txtMessage' type='text' MaxLength="10" onkeyup="Counter()" />
 <lable id='lblCounter'> 10</label>
 <br><br>
</body>
<html>

You might also like

1. file type validation in jquery
2. file size validation in jquery
3. calling web service without adding web reference
4. How to bind CheckBoxList from database
5. How to bind DropdownList from database

Tuesday, 15 November 2016

System.Array' does not contain a definition for 'Count' and no extension method 'Count' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?

System.Array' does not contain a definition for 'Count' and no extension method 'Count' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?

This error we got many times at runt time.
We need to add namespace for this


Soulution

using System.Linq;


This error may be like these:
System.Array does not contain a definition for 'Count'
system.array does not contain a definition for skip
'system.array' does not contain a definition for 'add'
c# system array does not contain a definition for where
'system.array' does not contain a definition for 'split'
system array does not contain a definition for length
'system.array' does not contain a definition for 'contains'
string does not contain a definition for length

how to access session in class c#

how to access session in class c#
Here I will explain how to access session in class c#, we already use session in any code behind like page code. But some time required to access session value in class file or set session value in class file then we need to use like following syntax.

Example


string Value =Convert.ToString(HttpContext.Current.Session["Id"]);

this code working fine in any code behind file like default.aspx.cs



Convert.ToString(Session["Id"])


How to access session variables from any class in ASP.NET C#
the name session does not exist in the current context
how to access session in class c#


Asp.net tutorials