ASP.NET中GridView分页
方法一:
新建一个页面然后在页面拖一个GridView控件在属性框中设置GridView控件的AllowPaing属性为True 然后再设置GridView的PageSize属性,源文件如下:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames ="classId" CellPadding="5" OnRowDeleting="GridView1_RowDeleting" AllowPaging="True" OnPageIndexChanging="GridView1_PageIndexChanging" PageSize ="15">
<Columns>
<asp:BoundField DataField ="className" HeaderText ="名称" />
<asp:BoundField DataField="classDes" HeaderText="描述" SortExpression="classDes" />
</Columns>
<PagerTemplate>
<table style="font-size :12px;">
<tr>
<td> 总共<asp:Label ID="Label1" runat="server" Text="<%#((GridView)Container.NamingContainer).PageCount %>"></asp:Label>页 </td>
<td> 第<asp:Label ID="Label2" runat="server" Text="<%#((GridView)Container.NamingContainer).PageIndex+1 %>"></asp:Label>页 </td>
&n
相关文档:
Data Source=sqlservername;Initial Catalog=dbname;User ID=userid;Password=userpwd
Data Source=(local)\\SQLEXPRESS;Initial Catalog=数据库名;Integrated Security=True
Data Source=(local);Initial Catalog=数据库名;User ID=帐号;Password=帐号密码
Provider=Microsoft.Jet.OleDb.4.0;Data Source=C:\BegASPNET\ ......
用DataBinder.eval 绑定数据不必关心数据来源(Dataread或dataset)也不必关心数据的类型,eval会把这个数据对象转换为一个字符串。是底层绑定做了很多工作,使用了反射性能。正因为使用方便了,但却影响了数据性能。当与dataset绑定时,DataItem其实是一个DataRowView(如果绑定的是一个数据读取器(dataread)它就是一个Idat ......
前台:
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
......
适用于:microsoft ASP.NET
摘要:asp.net动态生成html页面,适用
简介
此功能适用于后台数据库功能不强的web站点,即大部分文本不是存放在数据库的记录中,而是放在html文件或者xml文件中,仅仅把索引放到数据库中,如文章标题、类别、查询关键字等。这样适合于后台没有诸如ms Sql Server这样的数据库支持的Web站点。
适 ......
ASP.NET编程规范之命名规范都有哪些呢?具体又有什么内容呢?让我们开始吧:
ASP.NET编程规范之命名规范1.按钮ID命名:
btn+按钮操作功能(如btnSave)
ASP.NET编程规范之命名规范2.其它控件:
I.与数据操作相关:其ID<.SPAN>为相应的字段名称,如果有多个控件对应一个字段,则按以下规范命名:
字段名+&rdqu ......