Add(tableStart);
buttonLeft = new SuperButton();
buttonLeft.ID = "buttonLeft";
if (Context != null)
{
buttonLeft.Text = Context.Server.HtmlEncode("<") + " Left";
}
else
{
buttonLeft.Text = "< Left";
}
buttonLeft.CommandName = "Page";
buttonLeft.CommandArgument = "Left";
Controls.Add(buttonLeft);
LiteralControl spacer = new LiteralControl(" ");
Controls.Add(spacer);
buttonRight = new SuperButton();
buttonRight.ID = "buttonRight";
buttonRight.Display = Display;
if (Context != null)
{
buttonRight.Text = "Right " + Context.Server.HtmlEncode(">");
}
else
{
buttonRight.Text = "Right >";
}
buttonRight.CommandName = "Page";
buttonRight.CommandArgument = "Right";
Controls.Add(buttonRight);
LiteralControl tableEnd = new
LiteralControl("");
Controls.Add(tableEnd);
}
}
}
CHAPTER 5 ?– SERVER CONTROL EVEN TS 233
Using the Pager Control on a Web Form
The Pager Event Bubbling web form demonstrates the Pager control in both its button and
hyperlink display motifs. A single label represents the PageCommand activity generated by the
two controls. The first request for the page appears in the browser, as shown in Figure 5-17.
Listings 5-17 and 5-18 provide the .aspx and code-behind files for this web form.
Pages:
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336