日期:2014-05-19  浏览次数:20430 次

求gridview结合ajax查询、翻页等例子
如题,越详细、全面越好,谢谢!

------解决方案--------------------
页面上放个UpdatePanel把GridView放里面

然后就查询,翻页吧,无刷新了,就这么简单
------解决方案--------------------
别忘了再放一个scriptmanager
否则UpdatePanel是起不到作用的。
------解决方案--------------------

顶!
------解决方案--------------------
https://msevents.microsoft.com/cui/r.aspx?t=3&c=zh-cn&r=1289718096
看看这个你就会了解了
------解决方案--------------------
up
------解决方案--------------------
既然用了ajax就不必再用gridview了.你可以把数据返回到客户端,然后放入table中,或者在cs中生成table返回到一个div里.
我的一点代码希望对你有点帮助:
if (iPageIndex > = iPageCount)
iPageIndex = iPageCount;
iPageIndex = iPageIndex - 1;
sbRecord.Append( " <Table width=\ "100%\ " border=0 cellpadding=\ "5\ " cellspacing=\ "1\ " bgcolor=\ "#97A8C0\ "> <TR> ");
sbRecord.Append( " <TD height=\ "24\ " bgcolor=\ "#576E90\ "> <div align=\ "center\ " class=\ "STYLE1\ "> <strong> 编号 </strong> </div> </TD> ");
sbRecord.Append( " <TD bgcolor=\ "#40587C\ "> <div align=\ "center\ " class=\ "STYLE3\ "> 用户名 </div> </TD> ");
sbRecord.Append( " <TD bgcolor=\ "#40587C\ " class=\ "STYLE3\ "> 客人姓名 </TD> ");
sbRecord.Append( " <TD bgcolor=\ "#40587C\ "> <div align=\ "center\ " class=\ "STYLE3\ "> 酒店名称 </div> </TD> ");
sbRecord.Append( " <TD bgcolor=\ "#40587C\ "> <div align=\ "center\ " class=\ "STYLE3\ "> 预订时间 </div> </TD> ");
sbRecord.Append( " <TD bgcolor=\ "#40587C\ "> <div align=\ "center\ " class=\ "STYLE3\ "> 入住时间 </div> </TD> ");
sbRecord.Append( " <TD bgcolor=\ "#40587C\ "> <div align=\ "center\ " class=\ "STYLE3\ "> 实际离店时间 </div> </TD> ");
sbRecord.Append( " <TD bgcolor=\ "#40587C\ "> <div align=\ "center\ " class=\ "STYLE3\ "> 入住状态 </div> </TD> ");
sbRecord.Append( " <TD bgcolor=\ "#40587C\ "> <div align=\ "center\ " class=\ "STYLE3\ "> 消费金额 </div> </TD> ");
sbRecord.Append( " <TD bgcolor=\ "#40587C\ "> <div align=\ "center\ " class=\ "STYLE3\ "> 确认码 </div> </TD> ");
sbRecord.Append( " </TR> ");
sbRecord.Append( " <TR bgcolor=\ "#97A8C0\ "> ");
sbRecord.Append( " <TD height=\ "3\ " colspan=\ "9\ "> </TD> ");
sbRecord.Append( " </TR> ");
if (iRecordCount > 0)
{
_dataAccessLayer.addNewParameter( "@tablename ", "resvlog ", 100);
_dataAccessLayer.addNewParameter( "@fieldlist ", "id,userid,guestfirstname,propertyname,convert(char(10),starttime,020),convert(char(10),deptime,020),convert(char(10),departure,020),totalrevenue,confnum,status,getstatus,gue