悬赏园豆:10
[已解决问题]
解决于 2008-06-06 10:06
<P>入行不深,很简单的思路做的:</P>
<P>自定义<pagetemplate>,里面有"上一页","下一页"等按扭<BR><asp:button CommandName="page" CommandArgument="prev" >...能正常使用.</P>
<P>数字分页号我是这么实现的:<BR>在Gridview DataBound 事件里添加数字的<linkbutton>,然后在Gridview尾部添加这些控件,源代码如下:</P>
<P>protect void GridView2_DataBound(object sender , EventArgs e)<BR>{<BR> GridViewRow pagerow = GridView2.BottomPagerRow;<BR> LinkButton[] mybutton = new LinkButton[GridView2.PageCount];<BR> for (int i = 0; i < mybutton.Length; i++)<BR> {<BR> mybutton[i] = new LinkButton();<BR> mybutton[i].Text = (i + 1).ToString();<BR> mybutton[i].Click += new EventHandler(newsClass_Click);<BR> mybutton[i].EnableViewState = true;<BR> pagerow.Cells[0].Controls.Add(mybutton[i]);<BR> }</P>
<P>}</P>
<P>问题是:当我按数字选择分页时能正常运行,但数字分页按扭就不见了。但按“上一页”,“下一页”能正常分页,也能显示数字分页按扭。。</P>
<P>请大家帮忙解决一下</P>
<P mce_keep="true"> </P>
<P mce_keep="true"> </P>