using System.Data;

 

namespace StateManagement

{

    public partial class SessionExample2 : System.Web.UI.Page

    {

        protected void Page_Load(object sender, EventArgs e)

        {

            if (!IsPostBack)

            {

                // The Dataset was filled with records during Session_Start event

                // in the Global.asax file.

                DataSet myDS = (DataSet)Session["DS"]; ;

                gvProducts.DataSource = myDS;

                gvProducts.DataBind();

            }

        }

 

        protected void btnNextPage_Click(object sender, EventArgs e)

        {

            Response.Redirect("SessionExample2b.aspx");

        }

    }

}