Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 1st, 2006, 11:54 PM
Registered User
Join Date: Jul 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to nicesukhi Send a message via Yahoo to nicesukhi
Default Paging and Data base connectivity

I am doing some work on website in which i want to making multiple pages becoz my data cannot be fit into one page and i do not want scrolbar so what i want to do is place numbers like this

             <[u]1 2 3 4 5 </u>>

so that when i click on any number i can go to that page and there is also wrriten that i am on 2 page 5

   If anybody can help me out i will be very greatfull to that person

Old August 2nd, 2006, 09:33 AM
Authorized User
Join Date: Jun 2006
Posts: 85
Thanks: 0
Thanked 0 Times in 0 Posts

In ASPX page, create datagrid and set settings as allowpaging =true and pagerstyle-pagebutton count =25 and pagesize =20

       <asp:DataGrid id="dg" HeaderStyle-Font-Bold="True" runat="Server" AutoGenerateColumns="False"
          AllowSorting="True" BorderColor="#88AABB" CellSpacing="0" CellPadding="0"
        GridLines="Both" AllowPaging="True" PagerStyle-PageButtonCount="25" PageSize="20" Width=98%>
        <HeaderStyle BackColor="SteelBlue" HorizontalAlign=Left Font-Bold="True"/>
        <PagerStyle HorizontalAlign="Center" Mode="NumericPages"/>
        <ItemStyle HorizontalAlign=Left/>
           <asp:BoundColumn SortExpression="DBField1" DataField="DBField1" HeaderText="Header1"/>
           <asp:BoundColumn SortExpression="DBField2" DataField="DBField2" HeaderText="Header2"/>

and in code behind write like this

    Protected Sub dg_PageIndexChanged(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridPageChangedEvent Args) Handles dg.PageIndexChanged
            dg.CurrentPageIndex = e.NewPageIndex
        Catch ex As Exception
        End Try
    End Sub

Similar Threads
Thread Thread Starter Forum Replies Last Post
Data base Format virus220 ASP.NET 2.0 Professional 0 August 10th, 2007 09:37 AM
Data base connectivity watashi C# 2005 8 July 18th, 2007 08:05 PM
Data Connectivity Ned Flash (all versions) 4 March 30th, 2007 08:15 PM
Transfering data from csv file to data base g_vamsi_krish ASP.NET 1.0 and 1.1 Professional 2 May 16th, 2006 11:58 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.