using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Text;

/* =====================================================================

  File:      Default.aspx.cs for Adventure Works Cycles Storefront Sample
  Summary:   Home page for the application.  Provides news, popular item info, and instructions
			 for what to do with the application.
  Date:	     June 16, 2003

---------------------------------------------------------------------

  This file is part of the Microsoft SQL Server Code Samples.
  Copyright (C) Microsoft Corporation.  All rights reserved.

This source code is intended only as a supplement to Microsoft
Development Tools and/or on-line documentation.  See these other
materials for detailed information regarding Microsoft code samples.

THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.

======================================================= */

namespace Microsoft.Samples.SqlServer 
{

    public partial class DefaultPage : System.Web.UI.Page
    {

    
//         public DefaultPage() {
//             Page.Init += new System.EventHandler(Page_Init);
//         }

        //*******************************************************
        //
        // The Page_Load event on this page is used to personalize
        // the welcome message seen by returning AdventureWorks users.
        // It does this by retrieving a client-side cookie
        // (persisted on the client in the Login.aspx and
        // register.aspx pages) and updating a label control.
        //
        //*******************************************************

        private void Page_Load(object sender, System.EventArgs e) {

            // Customize welcome message if personalization cookie is present
			if (Request.Cookies["AdventureWorks_FullName"] != null)
			{				
				UnicodeEncoding unicode = new UnicodeEncoding();

				WelcomeMsg.Text = "Welcome " +
								  unicode.GetString(Convert.FromBase64String(Request.Cookies["AdventureWorks_FullName"].
														   Value));
			}
        }

        private void Page_Init(object sender, EventArgs e) {
            //
            // CODEGEN: This call is required by the ASP.NET Web Form Designer.
            //
            InitializeComponent();
        }

		#region Web Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent() {
		}
		#endregion

    }
}