Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
MSDN Library

WebGrid.PageIndex Property

Gets or sets the index of the current page of the WebGrid instance.

Namespace:  System.Web.Helpers
Assembly:  System.Web.Helpers (in System.Web.Helpers.dll)

public int PageIndex { get; set; }

Property Value

Type: System.Int32
The index of the current page.


The PageIndex property cannot be set because paging is not enabled.

If paging is enabled, the first page of a WebGrid instance has an index of 1.

If paging is not enabled, getting the value of the PageIndex property returns 0, and trying to set the value of the PageIndex property causes an exception.

  • Medium trust for the immediate caller. This member can be used by partially trusted code.
© 2015 Microsoft