在ItemCreate事件里加入下面代码
ListItemType elemType = e.Item.ItemType; ////////////////// Pager ///////////////////////////
//
if (elemType == ListItemType.Pager)
{
// The pager as a whole has the following layout:
//
// <TR><TD colspan=X> ... links ... </TD></TR>
//
// Item points to <TR>. The code below moves to <TD>.
TableCell pager = (TableCell) e.Item.Controls[0]; // Loop through the pager buttons skipping over blanks
// (Blanks are treated as LiteralControl(s)
for (int i=0; i<pager.Controls.Count; i+=2)
{
Object o = pager.Controls[i];
if (o is LinkButton)
{
LinkButton h = (LinkButton) o;
h.Text = "[ " + h.Text + " ]";
}
else
{
Label l = (Label) o;
l.Text = "Page " + l.Text;
}
}
ListItemType elemType = e.Item.ItemType; ////////////////// Pager ///////////////////////////
//
if (elemType == ListItemType.Pager)
{
// The pager as a whole has the following layout:
//
// <TR><TD colspan=X> ... links ... </TD></TR>
//
// Item points to <TR>. The code below moves to <TD>.
TableCell pager = (TableCell) e.Item.Controls[0]; // Loop through the pager buttons skipping over blanks
// (Blanks are treated as LiteralControl(s)
for (int i=0; i<pager.Controls.Count; i+=2)
{
Object o = pager.Controls[i];
if (o is LinkButton)
{
LinkButton h = (LinkButton) o;
h.Text = "[ " + h.Text + " ]";
}
else
{
Label l = (Label) o;
l.Text = "Page " + l.Text;
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货