<%@ Page Language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <script runat="server"> private string MyProperty1 { get { return Session["MyProperty1"].ToString() ;} set { Session["MyProperty1"] = value;} } private string MyProperty2; void Button1_Click(object sender, EventArgs e) { MyProperty1 = "Button1"; MyProperty2 = "Button1"; Literal1.Text = MyProperty1; Literal1.Text += " "; Literal1.Text += MyProperty2; } void Button2_Click(object sender, EventArgs e) { Literal1.Text = MyProperty1; Literal1.Text += " "; Literal1.Text += MyProperty2; } </script> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> </head> <form id="form1" runat="server"> </form> </html>