asp.net paging source code

2 views
Skip to first unread message

gayancc

unread,
Nov 5, 2009, 11:47:21 PM11/5/09
to Techකතා
මා හට asp.net (c#) paging ගැන ඉගෙන ගැනීමට අවශ්‍යයි. ඒ පිලිබදව දන්නා
කෙනෙක් මට source code එකක් හරි හොද reference එකක් හරි ලබා දීමට
පුලුවනිද?

බොහොම ස්තුතියි

Harshana

unread,
Nov 6, 2009, 1:27:41 AM11/6/09
to tech...@googlegroups.com


Cheers !,
හර්ෂණ | Harshana
http://Harshana.net
http://DevSmart.net
 



2009/11/6 gayancc <gay...@gmail.com>

මා හට asp.net (c#) paging ගැන ඉගෙන ගැනීමට අවශ්‍යයි. ඒ පිලිබදව දන්නා
කෙනෙක් මට source code එකක් හරි හොද reference එකක් හරි ලබා දීමට
පුලුවනිද?

Gayan

unread,
Nov 6, 2009, 1:37:46 AM11/6/09
to tech...@googlegroups.com
 බොහොම ස්තුතියි හර්ශන එහි asp.net paging ගැන නම් විස්තර නැත මට උවමනා වී ඇත්තේ මාගේ blog එකට menual pagin system එකක් add  කිරීමටයි asp.net datagrid හි paging කිරීම වැදගත් නැත.

ස්තුතියි

2009/11/6 Harshana <wmhar...@gmail.com>

Harshana

unread,
Nov 6, 2009, 2:50:52 AM11/6/09
to tech...@googlegroups.com


Cheers !,
හර්ෂණ | Harshana
http://Harshana.net
http://DevSmart.net

 



2009/11/6 Gayan <gay...@gmail.com>

 බොහොම ස්තුතියි හර්ශන එහි asp.net paging ගැන නම් විස්තර නැත මට උවමනා වී ඇත්තේ මාගේ blog එකට menual pagin system එකක් add  කිරීමටයි asp.net datagrid හි paging කිරීම වැදගත් නැත.

is it for show blog content ? better use ASP.Net GridView with custom filed. U can do anything what U want, it's very easy to use
 

Gayan

unread,
Nov 6, 2009, 3:10:57 AM11/6/09
to tech...@googlegroups.com
but i don't know how it customize can you help me to do it please?

Harshana

unread,
Nov 6, 2009, 11:56:35 AM11/6/09
to tech...@googlegroups.com
busy with office works, this is sample I have written, Used AdventureWorks 2005 DB for this. download the DB and try or write Ur own one like this, U can customize what ever U need, U can use DIV, TABLES, OR any other HTML tags inside the TemplateField.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title>TemplateField Sample</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
            ShowHeader="False" DataSourceID="SqlDataSource1" PageSize="4">
            <Columns>
                <asp:TemplateField>
                    <ItemTemplate>
                        <br />
                        <asp:Label ID="lblName" Text='<%# Eval("Name") %>' runat="server" />
                        <br />
                        <asp:Label ID="ProductNo" Text='<%# Eval("ProductNumber") %>' runat="server" />
                        <table cellpadding="0" cellspacing="0" border="1">
                            <tr>
                            <td style="width:100px">
                                Date :
                            </td>
                                <td>
                                
                                    <asp:Label ID="Label1" Text='<%# Eval("SellStartDate") %>' runat="server" />
                                </td>
                            </tr>
                        </table>
                        <br />
                        <br />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:AdventureWorksConnectionString %>"
            SelectCommand="SELECT [ProductID], [Name], [ProductNumber], [MakeFlag], [FinishedGoodsFlag],[SellStartDate] FROM [Production].[Product]">
        </asp:SqlDataSource>
    </div>
    </form>
</body>
</html>




Cheers !,
හර්ෂණ | Harshana
www.හර්ෂණ.net
www.Harshana.Net
www.DevSmart.Net



2009/11/6 Gayan <gay...@gmail.com>

Gayan

unread,
Nov 7, 2009, 7:23:50 AM11/7/09
to tech...@googlegroups.com
thanks harshana thank you very much for your help

2009/11/6 Harshana <wmhar...@gmail.com>

Gayan

unread,
Nov 8, 2009, 1:25:34 AM11/8/09
to tech...@googlegroups.com
dear harshana do you have any idea how make a paging system manually? becourse it's hard to customize grideview :(
i need each page content show like this manner


1 2
3 4
5 6

but datagrid getting result only this manner
1
2
3
4
5
6


2009/11/7 Gayan <gay...@gmail.com>

Harshana

unread,
Nov 8, 2009, 1:45:56 AM11/8/09
to tech...@googlegroups.com
Cheers !,
හර්ෂණ | Harshana
http://Harshana.net
http://DevSmart.net
 
Chat Google Talk: m...@harshana.net Skype: wmharshana MSN: hars...@live.com Y! messenger: wmharsha
Contact Me LinkedinFacebookFlickrTwitterGoogleLast.fmdel.icio.usFriendfeedMySpaceDiggSlidesharePicasa

 


2009/11/8 Gayan <gay...@gmail.com>

dear harshana do you have any idea how make a paging system manually? becourse it's hard to customize grideview :(
i need each page content show like this manner


1 2
3 4
5 6

but datagrid getting result only this manner
1
2
3
4
5
6

Not clear what r u asking, can u send me some sample grid ?


by default like this

Datatatata  2nd Col Data
Datatatata  2nd Col Data
Datatatata  2nd Col Data
Datatatata  2nd Col Data
   
Page No 1, 2, 3 …. Last  



 

Gayan

unread,
Nov 8, 2009, 1:59:27 AM11/8/09
to tech...@googlegroups.com
this red section data only load one by one order so i need customize it like

1                                    2

3                                    4
 
5                                    6

order

2009/11/8 Harshana <wmhar...@gmail.com>

Harshana

unread,
Nov 8, 2009, 4:07:07 AM11/8/09
to tech...@googlegroups.com


Cheers !,
හර්ෂණ | Harshana
http://Harshana.net
http://DevSmart.net
 
Chat Google Talk: m...@harshana.net Skype: wmharshana MSN: hars...@live.com Y! messenger: wmharsha
Contact Me LinkedinFacebookFlickrTwitterGoogleLast.fmdel.icio.usFriendfeedMySpaceDiggSlidesharePicasa

 



2009/11/8 Gayan <gay...@gmail.com>
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

easiest way is Write a Query to get 1,3,5,7 ( ROW_NO - ODD)  like Values to One Column and 2,4,6,8 ( ROW_NO - EVEN)  like values to another column ,use 2 TemplateFields.



Gayan

unread,
Nov 8, 2009, 4:33:00 AM11/8/09
to tech...@googlegroups.com
ok thank you very much

2009/11/8 Harshana <wmhar...@gmail.com>
Reply all
Reply to author
Forward
0 new messages