易截截图软件、单文件、免安装、纯绿色、仅160KB

Asp.Net分页代码

分页是最常用的功能之一,这段分页代码适合初学者。
以新闻分页为例,代码共包含三个部分:一是分页页码显示,二是显示当前页的新闻,三是后台代码。
一、页码显示
  1.在后台定义一个变量:protected string PageInfo = "";
  2.执行分页,赋值后在前台输出:<%=PageInfo%>
二、显示当前页的新闻
  使用Repeater绑定当前页的新闻。示例如下:
  前台代码
<table align="center" class="style1" border="0" cellpadding="0" cellspacing="1">
<asp:Repeater ID="Repeater1" runat="server">
<HeaderTemplate>
<tr>
<td class="style_check">
</td>
<td class="style_id">
编号</td>
<td class="style_title" align="center">
标 题</td>
<td class="style_time">
发布时间</td>
<td class="style_updater">
责任编辑</td>
<td class="style_operate">
状 态</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr class="row" onmouseout="javascript:this.className='row';" onmouseover="javascript:this.className='row1';">
<td class="style_check">
<input name="Item" type="checkbox" value='<%# Eval("ID")%>'/></td>
<td class="style_id">
<%#Eval("ID") %></td>
<td class="style_title2">
<a title="点击查看其内容" href="../../ShowNews.aspx?SearchType=Normal&ShowType=Normal&ID=<%#Eval(" mce_href="ShowNews.aspx?SearchType=Normal&amp;ShowType=Normal&amp;ID=&lt;%#Eval("ID") %>" target="_blank"><%#Rdh2010.Common.Comm.G


相关文档:

asp.net一夜速成:总结&深入

命名空间:
Socut.Data
//##################### CData 类 #####################
实现功能:读取(DataSet方式),插入,更新,删除,统计
调用方法:
public CData myData=new CData();
实际操作:
1,读取
public DataSet ds=new DataSet(); //此DataSet类已经由微软封装提供
ds=myData.GetDataSet("SELECT * from ......

ASP.NET MVC post提交表单 后台值为空

昨天遇到了一个小问题,提交表单的时候,后台的action中验证的表单里的控件值居然是空值,调来调去不得其法.
我在前台的表单里控件用的是标准html控件
页面上使用下面语句发送form
<%using (Html.BeginForm("AddNewPicGroups", "MetaData")){ %>
后台使用如下语句接收时却接收不到数据
public ActionResult AddNew ......

在ASP.NET下使用jQuery UI下的Dialog产生提交空值问题

JQuery下的UI控件似乎是有问题的,某天我从凌晨两点调试一个JQuery Dialog,一直到早上8:00都没有调试出来。当时我在Dialog里面放置了一个服务器按钮,并让按钮和CodeBehind里的一个事件处理函数绑定,但是奇怪的是怎么点击按钮,都不响应后面的事件函数,整得我直抓狂。
天亮后,Google了一下,终于找到原因:JQuery会把 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号