Launch offer
Business website $150 USD Custom plugin $200 USD Ready in 5 days
Get a quote
ASP.NET

ViewState in Web Forms

Persist control state across postbacks via ViewState.

ViewState in Web Forms — a practical guide to Web Forms ViewState with clear examples you can reuse in real projects.

ASP & ASP.NET Tutorial Series (73/247). Prefer one article? Read the complete ASP.NET tutorial.

Short description

Disable ViewState on controls that don’t need it.

ViewState tip

ViewState["step"] = 2;
var step = (int)(ViewState["step"] ?? 0);

Leave a reply

Your email address will not be published. Required fields are marked *