using System;
using System.Collections.Generic;
using System.Text;

namespace JuSNS.AppClient
{
    public class BasePage : System.Web.UI.Page
    {
        private int _UserID;
        protected int UserID
        {
            get { return _UserID; }
        }
        public BasePage()
        {
            this.Load += new EventHandler(BasePage_Load);
            this.LoadComplete += new EventHandler(BasePage_LoadComplete);
        }

        public void BasePage_Load(object sender, EventArgs e)
        {
            string url = Config.ServerUrl + "/iframe.htm";
            AppClient.Application.Start();
            _UserID = AppClient.User.UserID;

            /**
            StringBuilder sb = new StringBuilder();
            sb.Append("<script language=\"javascript\" type=\"text/javascript\">;\n");
            
            sb.Append("var ifr=document.createElement(\"iframe\");\n");
            sb.Append("ifr.setAttribute(\"id\",\"ClientFrame\");\n");
            sb.Append("ifr.setAttribute(\"src\",\"ClientFrame\");\n");
            sb.Append("ifr.setAttribute(\"style\",\"display:none\");\n");
            sb.Append("document.body.appendChild(ifr)");
            sb.Append("function loadheight();\n");
            sb.Append("{\n");
            sb.Append("document.getElementById(\"ClientFrame\").src=\"" + url + "#" + "\"+document.body.scrollHeight;\n");
            sb.Append("}\n");
            sb.Append("if(window.attachEvent)document.body.attachEvent(\"onload\",loadheight);\n");
            sb.Append("if(window.addEventListener)document.body.addEventListener(\"load\",loadheight,false);\n");
            this.ClientScript.RegisterClientScriptBlock(typeof(string), "ClientScript", sb.ToString());
        
             **/
          }

        public void BasePage_LoadComplete(object sender, EventArgs e)
        {

        }
    }
}
