using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace SimpleUpdatePanelDemo
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            this.TextBox1.Text = DateTime.Now.ToLongTimeString();
            this.TextBox2.Text = DateTime.Now.ToLongTimeString();
            this.ClientScript.RegisterClientScriptBlock(this.GetType(), "MyOriginalAlert", "alert('Załadowano skrypt za pomocą metody ClientScript.RegisterClientScriptBlock');", true);
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "MyOriginalScriptManagerAlert", "alert('Załadowano skrypt za pomocą metody ScriptManager.RegisterClientScriptBlock');", true);
            ScriptManager.RegisterClientScriptBlock(this.TextBox2, typeof(TextBox), "TextBox2Script", "alert('To jest skrypt związany z kontrolką TextBox2')", true);
            ScriptManager.RegisterOnSubmitStatement(this, this.GetType(), "MyOnSubmitAlert", "alert('Wysyłamy żądanie');");
            ScriptManager.RegisterOnSubmitStatement(this.TextBox2, typeof(TextBox), "MyOnSubmitTextBoxAlert", "alert('Wysyłamy wartość pola tekstowego');");
            ScriptManager.RegisterStartupScript(this, this.GetType(), "MyStartupAlert", "alert('Zaczynamy');",true);
            ScriptManager.RegisterStartupScript(this.TextBox2, typeof(TextBox), "MyStartupTextBoxAlert", "alert('Generujemy pole tekstowe');",true);
        }
   
    }
}
