Web Tutorials

Interview Q & A

Code Examples

Utility Tools

ASP.NET Page SaveStateComplete Event and Set Page Variables Value

ASP.NET SaveStateComplete event will be fired after completion of PreRenderComplete event in asp.net page life cycle.

Syntax

protected void Page_SaveStateComplete(object sender, EventArgs e)
{
	//Code will come here.  
}

ASP.NET Page SaveStateComplete Event and Set Page Variables Value Example - Default.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" 
Inherits="_Default" %>
<!DOCTYPE html">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Label ID="lblTitle" runat="server" Text="ASP.NET Page Life Cycle"></asp:Label><br />
        <asp:label ID="lblDisplayPageEventsSteps" runat="server" text="Label"></asp:label>
    </div>
    </form>
</body>
</html>

ASP.NET Page SaveStateComplete Event and Set Page Variables Value Example - Default.aspx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page
{
	string _DefaultValue = "";
    protected void Page_SaveStateComplete(object sender, EventArgs e) 
	{ 
	   _DefaultValue = this.lblDisplayPageEventsSteps.Text;
	}
}

RequiredFieldValidator

RegularExpressionValidator

RangValidator

CompareValidator

CustomValidator

ValidationSummary