Mobile Content

Saturday, November 5, 2011

How many character remaining code in

Character count get increment and decrement when it get typed or deleted from textbox

 <script language="javascript">
    function count()
        var keyid=event.KeyCode;

        var c=document.getElementById('TextBox1').value.length;
           alert("Character exeed");
  switch (keyid)
    case 8:
    document.getElementById('Text1').value=( document.getElementById('Text1').value - c);
    case 46:
    document.getElementById('Text1').value=(document.getElementById('Text1').value - c);

        <asp:TextBox ID="TextBox1" runat="server" onKeyPress="count()" onKeyDown="count()" MaxLength="10"></asp:TextBox>
        <br />
    <label>10-></label> <input id="Text1" type="text" disabled="disabled" />

Wednesday, November 2, 2011

CultureInfo Class - populate the dropdownlist with countries using culture in with vb

in Default.aspx.vb

Imports System.Globalization
Imports System.Collections.Generic

 Public Function getcountry() As List(Of String)
        Dim list As New List(Of String)()
        Dim culture As CultureInfo() = CultureInfo.GetCultures(CultureTypes.InstalledWin32Cultures Or CultureTypes.SpecificCultures)

        For Each info As CultureInfo In Culture
            Dim info2 As New RegionInfo(info.LCID)
            If Not List.Contains(info2.EnglishName) Then

            End If

        Return List
    End Function

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
      DropDownList1.DataSource = getcountry()

         DropDownList1.Items.Insert(0, "select")

    End Sub