Here download the pdf file to know the details about the new features added in asp.net 4 and visual studio 2010.This PDF file would help you to work with advanced feature in visual 2010..

This document provides an overview of many of the new features for ASP.NET that are included in the.NET Framework 4 and in Visual Studio 2010.



Introduction:
In this article going to see about to display remaining character count in multiline textbox…
Normally this method used to display the remaining character user can able to enter in the textbox…
By limit to certain limit length, total length used to display using this method……


Java script Code:
<script type="text/javascript" language="Javascript">
        function textCounter(field, countfield, maxlimit) {
            if (field.value.length > maxlimit)
                field.value = field.value.substring(0, maxlimit);
            else
                countfield.value="charactes left ";
                countfield.value +=maxlimit - field.value.length;
        }
    </script>

<div>
         <asp:TextBox ID="TextBox1" runat="server" Height="100" Width="550" Wrap="true"
           TextMode="MultiLine" onkeyup="textCounter(TextBox1, TextBox2, 50);"
           onkeydown="textCounter(TextBox1,TextBox2, 50);" />   
    </div>
<div>
      <asp:TextBox ID="TextBox2"
          runat="server" style="color :Red;" ></asp:TextBox>
    </div>

I hope you like these easy methods to display character count…
Post your comments here…

11:33 AM

Take Print only gridview data in asp.net

Posted by vijay


Introduction:
Here you will learn to print only grid view content in asp.net web page.

In a previous article I wrote to print a web page for you reference I given the following below..


Some case we need to print only grid view data, In that case we follow this method code..
Here I kept a grid view inside the panel, so when print we call directly the panel id to print..
First :
We have to create data table to bind in grid view.
Code:
DataTable dt=new DataTable();
    DataRow dr;
    DataRow dr1;
dt.Columns.Add("Name");
        dt.Columns.Add("mark");
        for (int i = 0; i < 5; i++)
        {
            dr = dt.NewRow();
            dr1 = dt.NewRow();
            dr["Name"] = i;
            dr["mark"] = i;
            dt.Rows.Add(dr);
            dt.Rows.Add(dr1);
}
GridView1.DataSource = dt;
        GridView1.DataBind();


Client side code:
<div>
        <asp:Panel ID="Panel1" runat="server">
         <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns ="false" CssClass ="td">
        <Columns >
        <asp:BoundField  HeaderText ="Name" DataField ="Name"></asp:BoundField>
        <asp:BoundField  HeaderText ="Mark" DataField ="Mark" />
        </Columns>
        </asp:GridView>
    </asp:Panel>
    </div>
<div>
<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick ="printItn();"/>
    </div>