DataList编辑、更新、取消、删除、分页(分页控件AspNetPager.dll)
2008-09-20 17:18
836 查看
1.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>DataList编辑、更新、取消、删除、分页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<asp:DataList ID="DataList1" runat="server" Font-Size="12px" Width="100%" DataKeyField="ProductID"
OnCancelCommand="DataList1_CancelCommand" OnDeleteCommand="DataList1_DeleteCommand"
OnEditCommand="DataList1_EditCommand" OnUpdateCommand="DataList1_UpdateCommand">
<HeaderTemplate>
<td>
au_id</td>
<td>
au_lname</td>
<td>
au_fname</td>
<td>
phone</td>
<td>
address</td>
<td>
编辑</td>
<td>
删除</td>
</HeaderTemplate>
<ItemTemplate>
<td>
<asp:Label ID="Lbl_au_id" Text='<%#Eval("au_id")%>' runat="server"></asp:Label>
</td>
<td>
<asp:Label ID="Lbl_au_lname" Text='<%#Eval("au_lname")%>' runat="server"></asp:Label>
</td>
<td>
<asp:Label ID="Lbl_au_fname" Text='<%#Eval("au_fname")%>' runat="server"></asp:Label>
</td>
<td>
<asp:Label ID="Lbl_phone" Text='<%#Eval("phone")%>' runat="server"></asp:Label>
</td>
<td>
<asp:Label ID="Lbl_address" Text='<%#Eval("address")%>' runat="server"></asp:Label>
</td>
<td>
<asp:LinkButton ID="LinkButton1" Text="编辑" CommandName="Edit" runat="server"></asp:LinkButton>
</td>
<td>
<asp:LinkButton ID="LinkButton3" Text="删除" CommandName="Delete" runat="server"></asp:LinkButton>
</td>
</ItemTemplate>
<EditItemTemplate>
<td>
<asp:Label ID="Lbl_au_id" Text='<%#Eval("au_id")%>' runat="server"></asp:Label>
</td>
<td>
<asp:TextBox ID="Txt_au_lname" Text='<%#Eval("au_lname")%>' runat="server"></asp:TextBox>
</td>
<td>
<asp:TextBox ID="Txt_au_fname" Text='<%#Eval("au_fname")%>' runat="server"></asp:TextBox>
</td>
<td>
<asp:TextBox ID="Txt_phone" Text='<%#Eval("phone")%>' runat="server"></asp:TextBox>
</td>
<td>
<asp:TextBox ID="Txt_address" Text='<%#Eval("address")%>' runat="server"></asp:TextBox>
</td>
<td>
<asp:LinkButton ID="LinkButton1" Text="更新" CommandName="Update" runat="server"></asp:LinkButton>
<asp:LinkButton ID="LinkButton2" Text="取消" CommandName="Cancel" runat="server"></asp:LinkButton>
</td>
<td>
<asp:LinkButton ID="LinkButton3" Text="删除" CommandName="Delete" runat="server"></asp:LinkButton>
</td>
</EditItemTemplate>
<FooterTemplate>
</FooterTemplate>
</asp:DataList>
</td>
</tr>
<tr>
<td align="center">
<webdiyer:AspNetPager ID="pager1" runat="server" Font-Size="12px" ShowCustomInfoSection="Left"
OnPageChanged="ChangePage" ShowInputBox="Always" CustomInfoSectionWidth="80%"
SubmitButtonText="go">
</webdiyer:AspNetPager>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
2.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Wuqi.Webdiyer;
public partial class DataList_DataList_DeleteUpdate1 : System.Web.UI.Page
public DataSet Minutepage(string tblName,string fldName,int PageSize,int PageIndex,int IsReCount,int OrderType,string strWhere)
{
SqlParameter[] parameters = {
new SqlParameter("@tblName", SqlDbType.VarChar,255),
new SqlParameter("@fldName",SqlDbType.VarChar,255),
new SqlParameter("@PageSize", SqlDbType.Int),
new SqlParameter("@PageIndex", SqlDbType.Int),
new SqlParameter("@IsReCount",SqlDbType.Bit),
new SqlParameter("@OrderType",SqlDbType.Bit),
new SqlParameter("@strWhere",SqlDbType.VarChar,1000)
};
parameters[0].Value = tblName;
parameters[1].Value = fldName;
parameters[2].Value = PageSize;
parameters[3].Value = PageIndex;
parameters[4].Value = IsReCount;
parameters[5].Value = OrderType;
parameters[6].Value = strWhere;
return DbHelperSQL.RunProcedure("PR_MinutePage", parameters, "ds");
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>DataList编辑、更新、取消、删除、分页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<asp:DataList ID="DataList1" runat="server" Font-Size="12px" Width="100%" DataKeyField="ProductID"
OnCancelCommand="DataList1_CancelCommand" OnDeleteCommand="DataList1_DeleteCommand"
OnEditCommand="DataList1_EditCommand" OnUpdateCommand="DataList1_UpdateCommand">
<HeaderTemplate>
<td>
au_id</td>
<td>
au_lname</td>
<td>
au_fname</td>
<td>
phone</td>
<td>
address</td>
<td>
编辑</td>
<td>
删除</td>
</HeaderTemplate>
<ItemTemplate>
<td>
<asp:Label ID="Lbl_au_id" Text='<%#Eval("au_id")%>' runat="server"></asp:Label>
</td>
<td>
<asp:Label ID="Lbl_au_lname" Text='<%#Eval("au_lname")%>' runat="server"></asp:Label>
</td>
<td>
<asp:Label ID="Lbl_au_fname" Text='<%#Eval("au_fname")%>' runat="server"></asp:Label>
</td>
<td>
<asp:Label ID="Lbl_phone" Text='<%#Eval("phone")%>' runat="server"></asp:Label>
</td>
<td>
<asp:Label ID="Lbl_address" Text='<%#Eval("address")%>' runat="server"></asp:Label>
</td>
<td>
<asp:LinkButton ID="LinkButton1" Text="编辑" CommandName="Edit" runat="server"></asp:LinkButton>
</td>
<td>
<asp:LinkButton ID="LinkButton3" Text="删除" CommandName="Delete" runat="server"></asp:LinkButton>
</td>
</ItemTemplate>
<EditItemTemplate>
<td>
<asp:Label ID="Lbl_au_id" Text='<%#Eval("au_id")%>' runat="server"></asp:Label>
</td>
<td>
<asp:TextBox ID="Txt_au_lname" Text='<%#Eval("au_lname")%>' runat="server"></asp:TextBox>
</td>
<td>
<asp:TextBox ID="Txt_au_fname" Text='<%#Eval("au_fname")%>' runat="server"></asp:TextBox>
</td>
<td>
<asp:TextBox ID="Txt_phone" Text='<%#Eval("phone")%>' runat="server"></asp:TextBox>
</td>
<td>
<asp:TextBox ID="Txt_address" Text='<%#Eval("address")%>' runat="server"></asp:TextBox>
</td>
<td>
<asp:LinkButton ID="LinkButton1" Text="更新" CommandName="Update" runat="server"></asp:LinkButton>
<asp:LinkButton ID="LinkButton2" Text="取消" CommandName="Cancel" runat="server"></asp:LinkButton>
</td>
<td>
<asp:LinkButton ID="LinkButton3" Text="删除" CommandName="Delete" runat="server"></asp:LinkButton>
</td>
</EditItemTemplate>
<FooterTemplate>
</FooterTemplate>
</asp:DataList>
</td>
</tr>
<tr>
<td align="center">
<webdiyer:AspNetPager ID="pager1" runat="server" Font-Size="12px" ShowCustomInfoSection="Left"
OnPageChanged="ChangePage" ShowInputBox="Always" CustomInfoSectionWidth="80%"
SubmitButtonText="go">
</webdiyer:AspNetPager>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
2.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Wuqi.Webdiyer;
public partial class DataList_DataList_DeleteUpdate1 : System.Web.UI.Page
public DataSet Minutepage(string tblName,string fldName,int PageSize,int PageIndex,int IsReCount,int OrderType,string strWhere)
{
SqlParameter[] parameters = {
new SqlParameter("@tblName", SqlDbType.VarChar,255),
new SqlParameter("@fldName",SqlDbType.VarChar,255),
new SqlParameter("@PageSize", SqlDbType.Int),
new SqlParameter("@PageIndex", SqlDbType.Int),
new SqlParameter("@IsReCount",SqlDbType.Bit),
new SqlParameter("@OrderType",SqlDbType.Bit),
new SqlParameter("@strWhere",SqlDbType.VarChar,1000)
};
parameters[0].Value = tblName;
parameters[1].Value = fldName;
parameters[2].Value = PageSize;
parameters[3].Value = PageIndex;
parameters[4].Value = IsReCount;
parameters[5].Value = OrderType;
parameters[6].Value = strWhere;
return DbHelperSQL.RunProcedure("PR_MinutePage", parameters, "ds");
}
相关文章推荐
- DataList编辑、更新、取消、删除、分页(分页控件 AspNetPager.dll)
- DataList编辑、更新、取消、删除、分页(分页控件AspNetPager.dll)
- [导入]DataList编辑、更新、取消、删除、分页(分页控件AspNetPager.dll)
- DataList编辑、更新、取消、删除、分页(分页控件AspNetPager.dll)
- ASP.NET中运用DataList控件来实现编辑、更新、删除、取消等功能
- asp.net之DataList的使用方法,及分页(存储过程创建),编辑,更新,删除
- DataList编辑、更新、取消、删除、分页
- DataList编辑、更新、取消、删除、分页
- DataList编辑、更新、取消、删除、分页
- DataList编辑、更新、取消、删除、分页
- DataList编辑、更新、取消、删除、分页
- DataList编辑、更新、取消、删除、分页
- DataList编辑、更新、取消、删除、分页
- asp.net之DataList的使用方法,及分页(存储过程创建),编辑,更新,删除 .
- DataList编辑、更新、取消、删除、分页
- asp.net之DataList的使用方法,及分页(存储过程创建),编辑,更新,删除
- 模拟网易邮箱实现全选,全不的功能/使用DataList实现 加入购物车,编辑,删除,更新,取消功能。/试完成Datalist使用存储过程来分页
- WebForm GridView设置分页,编辑,更新,取消,删除,按钮,以及排序。
- asp.net c# 对GridView编辑,删除,更新,取消的操作
- C# ASP.NET AspNetPager对DataList控件分页