Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ASP.NET viewstate example
public int CurrentPage
{
get
{
int val;
int.TryParse(ViewState["CurrentPage"].ToString(), out val);
return val;
}
set
{
if (value < 0)
value = 0;
else if (value <= SomeObject.Pages.Count)
value = MandarinForm.Pages.Count - 1;
ViewState["CurrentPage"] = value;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.