C# – GridView – Custom Paging in ASP .NET 2.0 with Microsoft SQL Server 2005 using ROW_NUMBER() and VirtualItemCount

0 Comments

Add a datagrid to your aspx page. Set the following properties in the designer: AutoGenerateColumns="false"         AllowPaging="true"         AllowCustomPaging="true"         AllowSorting="false" <asp:DataGrid         ID="dg"         AutoGenerateColumns="false"         AllowPaging="true"         AllowCustomPaging="true"         AllowSorting="false"         DataKeyField="Id"        

Setting the GridView PagerStyle height in ASP .NET 2.0 with C#

0 Comments

When you set the PagerStyle Height property this will no allways set the correct height of the PageStyle. <asp:GridView ID="Test"> <PagerStyle Height="10px" /> </asp:GridView> To set the correct height use a CSS class: <asp:GridView ID="Test">

Prevent session timeout in ASP .NET 2.0

0 Comments

To prevent a session timeout use the meta html tag in the header html tag:   <meta http-equiv="refresh" content="300" /><!-- prevent session timeout -->