我在以前各位大虾说的网址下载了分页控件,并且安装好了,也拖在了网页上,那怎么才能实现分页呢??
应该在那些地方添加程序啊??添些什么程序呢,有没有那位大虾用过,帮下忙,程序给份给我,好不?我的是动态查询,数据显示在datagrid中
应该在那些地方添加程序啊??添些什么程序呢,有没有那位大虾用过,帮下忙,程序给份给我,好不?我的是动态查询,数据显示在datagrid中
解决方案 »
- 如何 把 log4net 应用到 vs2005?
- 判断日期
- 中文乱码的问题
- 写自定义控件时候,如果属性是 Color类型,BorderStyle 类型,那么在 render() 函数中,如何使用这些属性值呢?
- 怎么我问的问题老是要几百分?
- 先送 100分 !ASPX技术生成XML文件问题,顶就有分,分多的是
- 各位大吓帮忙看看哪错了啊!
- 请教下各位高手如下的代码如何理解呢
- 书写错误???
- 如何在asp.net里面调用存储过程??
- 有妹妹结帖给了我100分,为什么我还只有10分?顺便问个问题!
- 打开项目打开项目时出错:无法从web 服务器获取项目文件,无法打开项目文件‘lgy’,位于服务器 'htt//localhost 'web 'lgy'不存在??
{
string sqlcount,sql,cond="";
if(string.Empty.Equals(Txbsearch.Text))
{
cond = "";
}
else if(!wst.common.RegexCheck.NumericCheck(Txbsearch.Text))
{
Response.Write("<script language='javascript'>alert('只能输入数字!');</script>");
}
else
{
cond = "where Cardid = "+Txbsearch.Text;
}
//得到总记录数
sqlcount = "select count(Cardid) as 总记录数 from CardInfo "+cond;
SqlDataReader dr = um.ExcuteRead(sqlcount);
if(dr.Read())
{
aspager.RecordCount = (int)dr["总记录数"];
}
dr.Close(); sql = "select * from CardInfo "+cond+" order by Cardid ";
DataView dv = um.ExcuteGet(sql,aspager.PageSize*(aspager.CurrentPageIndex-1),aspager.PageSize,"CardInfo").Tables["CardInfo"].DefaultView;
MyDataGrid.DataSource = dv;
MyDataGrid.DataBind();
aspager.CustomInfoText="记录总数:<font color=\"blue\"><b>"+aspager.RecordCount.ToString()+"</b></font>";
aspager.CustomInfoText+=" 总页数:<font color=\"blue\"><b>"+aspager.PageCount.ToString()+"</b></font>";
aspager.CustomInfoText+=" 当前页:<font color=\"red\"><b>"+aspager.CurrentPageIndex.ToString()+"</b></font>";
}
//翻页函数
private void aspager_PageChanged(object src, Wuqi.Webdiyer.PageChangedEventArgs e)
{
aspager.CurrentPageIndex=e.NewPageIndex;
BindGrid();
System.Text.StringBuilder sb=new StringBuilder("<script Language=\"Javascript\"><!--\n");
sb.Append("var el=document.all;");
sb.Append(MyDataGrid.ClientID);
sb.Append(".scrollIntoView(true);");
sb.Append("<");
sb.Append("/");
sb.Append("script>");
if(!Page.IsStartupScriptRegistered("scrollScript"))
Page.RegisterStartupScript("scrollScript",sb.ToString());
}
<HEAD>
<title>searchwagemessage</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<SCRIPT language="javascript" src="js\popup.js"></SCRIPT>
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<asp:panel id="Panel1" style="Z-INDEX: 101; LEFT: 40px; POSITION: absolute; TOP: 112px" runat="server"
Height="336px" Width="448px"></asp:panel><FONT face="宋体"></FONT><FONT face="宋体"></FONT><FONT face="宋体"></FONT><FONT face="宋体"></FONT><FONT face="宋体"></FONT><FONT face="宋体"></FONT><FONT face="宋体"></FONT><FONT face="宋体"></FONT><FONT face="宋体"></FONT><FONT face="宋体"></FONT><FONT face="宋体"></FONT><FONT face="宋体"></FONT><FONT face="宋体"></FONT>
<TABLE id="Table2" style="Z-INDEX: 105; LEFT: 8px; WIDTH: 592px; POSITION: absolute; TOP: 112px; HEIGHT: 361px"
cellSpacing="1" cellPadding="1" width="592" border="1">
<TR>
<TD style="HEIGHT: 11px" align="center" bgColor="#0099cc"><FONT face="宋体"><FONT face="宋体"><STRONG><FONT face="宋体"><FONT face="宋体" color="#ff0033"><STRONG>员工工资查询</STRONG></FONT></FONT></STRONG></FONT></FONT></TD>
</TR>
<TR>
<TD style="HEIGHT: 234px" align="center" bgColor="#ffffcc" colSpan="1" rowSpan="1">
<asp:Label id="Label2" runat="server" ForeColor="#400040" Font-Size="10">从</asp:Label>
<asp:TextBox id="TextBox2" runat="server" Width="69px" ReadOnly="True"></asp:TextBox><A onclick="fPopUpDlg('js/date.htm', document.forms[0].TextBox2, 'winpop',300,100, 234, 261);return false"
href="#"><IMG src="js\datetime.gif" border="0"></A>
<asp:Label id="Label3" runat="server" ForeColor="#400040" Font-Size="10">到 </asp:Label>
<asp:TextBox id="TextBox3" runat="server" Width="69px" ReadOnly="True"></asp:TextBox><A onclick="fPopUpDlg('js/date.htm', document.forms[0].TextBox3, 'winpop',300,100, 234, 261);return false"
href="#"><IMG src="js\datetime.gif" border="0"></A>
<asp:Label id="Label1" runat="server" Font-Size="10" ForeColor="#400040">员工编号</asp:Label>
<asp:TextBox id="TextBox1" runat="server" Width="84px"></asp:TextBox>
<asp:Button id="Button1" runat="server" Text="执行查询"></asp:Button><A onclick="fPopUpDlg('js/date.htm', document.forms[0].TextBox2, 'winpop',300,100, 234, 261);return false"
href="#"></A>
<DIV style="OVERFLOW: auto; WIDTH: 581px; HEIGHT: 208px">
<asp:DataGrid id="DataGrid1" runat="server" Width="570px" Height="64px" AllowCustomPaging="True"
AllowPaging="True" AutoGenerateColumns="False" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px"
BackColor="White" CellPadding="3" DataKeyField="ygid" ToolTip="双击查看详细信息" HorizontalAlign="Center">
<SelectedItemStyle Font-Bold="True" ForeColor="White" BackColor="#669999"></SelectedItemStyle>
<ItemStyle ForeColor="#000066"></ItemStyle>
<HeaderStyle Font-Bold="True" HorizontalAlign="Center" ForeColor="White" BackColor="#006699"></HeaderStyle>
<FooterStyle ForeColor="#000066" BackColor="White"></FooterStyle>
<Columns>
<asp:TemplateColumn>
<HeaderStyle Width="5px"></HeaderStyle>
<ItemTemplate>
<asp:CheckBox id="CB" runat="server"></asp:CheckBox>
</ItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn DataField="ygid" HeaderText="员工编号">
<HeaderStyle Font-Size="10pt" Width="100px"></HeaderStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="dixin" HeaderText="底薪">
<HeaderStyle Font-Size="10pt" Width="100px"></HeaderStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="jlwage" HeaderText="奖金">
<HeaderStyle Width="100px"></HeaderStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="chengfwage" HeaderText="惩罚金">
<HeaderStyle Width="100px"></HeaderStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="sfwage" HeaderText="实发工资">
<HeaderStyle Font-Size="10pt" Width="100px"></HeaderStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="wagedate" HeaderText="日期 ">
<HeaderStyle Font-Size="10pt" Width="100px"></HeaderStyle>
</asp:BoundColumn>
</Columns>
<PagerStyle Visible="False" NextPageText="下一页" PrevPageText="上一页" HorizontalAlign="Left" ForeColor="#000066"
BackColor="White" Mode="NumericPages"></PagerStyle>
</asp:DataGrid></DIV>
</TD>
</TR>
<TR>
<TD style="HEIGHT: 4px" vAlign="top" bgColor="#ffffcc"><FONT face="宋体"></FONT></TD>
</TR>
<TR>
<TD style="HEIGHT: 1px" align="center" bgColor="#0099cc" colSpan="1" rowSpan="1">
<asp:Button id="Button2" runat="server" Text="删除" Enabled="False"></asp:Button>
<asp:Button id="Button3" runat="server" Text="取消"></asp:Button></TD>
</TR>
<TR>
<TD align="center"><FONT face="宋体">
<webdiyer:AspNetPager id="AspNetPager1" runat="server" HorizontalAlign="Right" ShowInputBox="Always" SubmitButtonText="GO"
ShowCustomInfoSection="Left" Wrap="False" TextBeforeInputBox="转到第" TextAfterInputBox="页" InputBoxStyle="border:1px #0000FF solid;text-align:center"></webdiyer:AspNetPager></FONT></TD>
</TR>
</TABLE>
<asp:label id="Message" style="Z-INDEX: 102; LEFT: 256px; POSITION: absolute; TOP: 80px" runat="server"
Width="152px" Font-Size="15px" ForeColor="Red" Font-Bold="True"></asp:label><asp:button id="Button4" style="Z-INDEX: 103; LEFT: 72px; POSITION: absolute; TOP: 72px" runat="server"
Text="Button"></asp:button><asp:label id="Message1" style="Z-INDEX: 104; LEFT: 136px; POSITION: absolute; TOP: 80px" runat="server"
Width="88px" Font-Size="10pt" ForeColor="Red" Font-Bold="True"></asp:label></form>
</body>
</HTML>这是前台代码,那位好心的大虾帮忙看一下,应该怎么实现分页