예제 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //HtmlMeta meta = new HtmlMeta();
        //meta.HttpEquiv = "X-UA-Compatible";
        //meta.Content = "IE=edge";
        //HtmlHead head = Page.Header;
        //head.Controls.Add(meta);


        //GetCurrentDefaultStudyID();
        if (print_jminfo)
        {
            jminfo.Text += "**Load**..IsPostBack=" + IsPostBack.ToString() + "<br/>";
        }

        if (!IsPostBack)
        {
            if (Request.QueryString["coderpair"] != null & Request.QueryString["measureID"] != null)
            {
                int measureID = Convert.ToInt32(Request.QueryString["measureID"].ToString());
                Load_coderpair_list(measureID);

                string coderpair = Request.QueryString["coderpair"];
                LoadCoderPairDetails(coderpair);
            }
            else if (Request.QueryString["measureID"] != null)
            {
                int measureID = Convert.ToInt32(Request.QueryString["measureID"].ToString());
                Load_coderpair_list(measureID);

                UpdatePanel_coderpair_single.Visible = false;
            }
        }
    }
예제 #2
0
        private void Page_Init(object sender, System.EventArgs e)
        {
            Log.Log.WriteToLog(PageName + "Page_Init (IsPostBack=\"" + IsPostBack.ToString().ToLower() + "\")", true);

            /*
             * if(IsPostBack)
             * {
             *      string
             *              tmpString=string.Empty;
             *
             *      TextBox
             *              tmpTextBox;
             *
             *      foreach(DataGridItem item in DataGridWEvents.Items)
             *      {
             *              if((tmpTextBox=(item.FindControl(TextBoxSignature) as TextBox))==null)
             *                      continue;
             *
             *              if(tmpString!=string.Empty)
             *                      tmpString+=Environment.NewLine;
             *
             *              tmpString+=tmpTextBox.Text;
             *      }
             * }
             */
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            LogII.LogII.MakeFile(LogFileName, "Page_Load (IsPostBack=\"" + IsPostBack.ToString().ToLower() + "\")", true);

            if (!IsPostBack)
            {
                SqlDataSource4.SelectParameters["BirthDate"].DefaultValue = DateTime.Now.ToShortDateString();
            }
        }
예제 #4
0
        private void Page_Init(object sender, System.EventArgs e)
        {
            Log.Log.WriteToLog("FrameForm2.Page_Init() (IsPostBack=\"" + IsPostBack.ToString() + "\")", true);

            if ((TestDSVariable = (TestDS)Session["TestDS"]) == null)
            {
                TestDSVariable = new TestDS();
                Session.Add("TestDS", TestDSVariable);
            }
        }
예제 #5
0
 //この下をプログラマが書くイメージ
 private void Page_Load()
 {
     if (!IsPostBack)
     {
         this.label1.Text = "page_load_" + IsPostBack.ToString();
     }
     else
     {
         this.label1.Text = "page_load_" + IsPostBack.ToString();
     }
 }
예제 #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //  **      CHANGE CONNECTION PATHS     **  //
            //con = new SqlConnection("Data Source=(LocalDB)\\MSSQLLocalDB;AttachDbFilename='c:\\users\\administrator\\documents\\visual studio 2015\\Projects\\Ex_QAPersonalInfo\\Ex_QAPersonalInfo\\App_Data\\Database1.mdf';Integrated Security=True");
            //con = new SqlConnection("Data Source=(LocalDB)\\MSSQLLocalDB;AttachDbFilename='C:\\Users\\Sa\\Documents\\QA Consulting\\Training\\C#\\Ex_QAPersonalInfo\\Ex_QAPersonalInfo\\App_Data\\Database1.mdf';Integrated Security=True");
            con = new SqlConnection("Data Source = (LocalDB)\\MSSQLLocalDB; AttachDbFilename = 'C:\\Users\\Sa\\Documents\\GitHub\\Ex_QAPersonalInfo\\Ex_QAPersonalInfo\\App_Data\\Database1.mdf'; Integrated Security = True");

            try
            {
                con.Open();
            }
            catch (Exception exConnection)
            {
                Response.Write(exConnection.ToString());
            }

            Response.Write("-------------------->" + IsPostBack.ToString());

            if (!IsPostBack)
            {
                Response.Write("<h1>Edit Personal Info</h1>");
                Response.Write("<br />");
                //Response.Write("<input type='hidden' name='a' value='" + Request["PerID"].ToString() + "'>");

                Session["pickedPersonID"] = Request["PerID"].ToString();

                cmdLoadPerson            = new SqlCommand();
                cmdLoadPerson.Connection = con;

                try
                {
                    cmdLoadPerson.CommandText = "SELECT * FROM PersonalInfo WHERE QAID = '" + Session["pickedPersonID"] + "'";

                    reader = cmdLoadPerson.ExecuteReader();
                }
                catch (Exception exCommandSQL)
                {
                    Response.Write(exCommandSQL.ToString());
                }

                if (reader.Read())
                {
                    TextBoxName.Text    = reader["Name"].ToString();
                    TextBoxAddress.Text = reader["Address"].ToString();
                    reader.Close();
                }
                else
                {
                    Response.Write("<p>There is no record for this ID. Something has gone wrong.</p>");
                    reader.Close();
                }
            }
        }
예제 #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Button1.Click   += new EventHandler(Button1_Click);
            Button1.Command += new CommandEventHandler(Buttonasdf_Command);

            Label1.Text = "IsPostBack: " + IsPostBack.ToString() +
                          "<br />   Callback: " + IsCallback.ToString() +
                          "<br />   SupportsXmlHTTP: " + Page.Request.Browser.SupportsXmlHttp.ToString();

            Label3.Text = ClientScript.GetPostBackEventReference(LinkButton1, null);
            string cbReference = Page.ClientScript.GetCallbackEventReference(this,
                                                                             "arg", "GetRandomNumberFromServer", "context");
            string cbScript = "function UseCallback(arg, context)" +
                              "{" + cbReference + ";" + "}";

            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "UseCallback", cbScript, true);

            //HttpContext.Current.ApplicationInstance.
        }
예제 #8
0
        //---------------------------------------------------------------------------

        private void Page_Load(object sender, System.EventArgs e)
        {
            Log.Log.WriteToLog(PageName + "Page_Load (IsPostBack=\"" + IsPostBack.ToString().ToLower() + "\")", true);

            if (!IsPostBack)
            {
                if (Session[DataGridEventsFormDataSessionSignature] != null)
                {
                    Session.Remove(DataGridEventsFormDataSessionSignature);
                }
            }
            else
            {
                string
                    tmpString = string.Empty;

                TextBox
                    tmpTextBox;

                foreach (DataGridItem item in DataGridWEvents.Items)
                {
                    if ((tmpTextBox = (item.FindControl(TextBoxSignature) as TextBox)) == null)
                    {
                        continue;
                    }

                    if (tmpString != string.Empty)
                    {
                        tmpString += Environment.NewLine;
                    }

                    tmpString += tmpTextBox.Text;
                }
            }

            if ((Staff = (DataTable)Session[DataGridEventsFormDataSessionSignature]) == null)
            {
                Session[DataGridEventsFormDataSessionSignature] = Staff = new DataTable();
                FillDataTable(Staff);
                DataGridBind();
            }
        }
예제 #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string id;

        // Create a new ARulesXL engine
        arxl = new ARulesXL();

        // Get a unique session id for us
        id = "arulesxl_" + Session.SessionID;
        log("ARulesXL SessionID = " + Session.SessionID + "  ");

        // Log a bunch of details about our state and configuration
        if (Session.IsNewSession)
        {
            log(" NewSession");
        }
        log("Postback = " + IsPostBack.ToString());

        // IsPostBack is set when the user submits the form
        // So this is the second time through Page_Load
        // and we run the query
        if (IsPostBack)
        {
            // Run the ruleset
            log("PostBack");
            AnswerLabel.Visible = true;
            AnswerText.Visible  = true;
            runRuleset(id, Session.IsNewSession);
        }
        // This is the first time through Page_Load
        // Set default values for some of the controls
        else
        {
            RulesetFilename.Text = "advice.axl";
            Ruleset.Text         = "ShaftRules";
            Query.Text           = "FIND .advice";
            AnswerLabel.Visible  = false;
            AnswerText.Visible   = false;
        }
    }
예제 #10
0
        private void Page_Init(object sender, System.EventArgs e)
        {
            Log.Log.WriteToLog("MainForm.Page_Init() (IsPostBack=\"" + IsPostBack.ToString() + "\")", true);

            if ((TestDSVariable = (TestDS)Session["TestDS"]) == null)
            {
                TestDSVariable = new TestDS();
                Session.Add("TestDS", TestDSVariable);
            }

                        #if !IFRAME_ENABLED_VIEW_STATE
            if (!IsPostBack)
            {
                if (IFrame1.EnableViewState)
                {
                    IFrame1.EnableViewState = false;
                }
                if (IFrame2.EnableViewState)
                {
                    IFrame2.EnableViewState = false;
                }
            }
                        #endif

                        #if MAKE_IFRAME_SRC_IN_INIT
            string
                URLFrame1AddStr = string.Empty,
                URLFrame2AddStr = string.Empty;

            if (IsPostBack)
            {
                URLFrame1AddStr = URLFrame2AddStr = "IsPostBack=true";
            }

            IFrame1.Attributes["src"] = "FrameForm1.aspx" + (URLFrame1AddStr != string.Empty ? "?" : string.Empty) + URLFrame1AddStr;
            IFrame2.Attributes["src"] = "FrameForm2.aspx" + (URLFrame2AddStr != string.Empty ? "?" : string.Empty) + URLFrame2AddStr;
                        #endif
        }
예제 #11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //HtmlMeta meta = new HtmlMeta();
        //meta.HttpEquiv = "X-UA-Compatible";
        //meta.Content = "IE=edge";
        //HtmlHead head = Page.Header;
        //head.Controls.Add(meta);


        GetCurrentDefaultStudyID();
        if (print_jminfo)
        {
            jminfo.Text += "**Load**..IsPostBack=" + IsPostBack.ToString() + "<br/>";
        }

        if (Request.QueryString["measureID"] != null)
        {
            int measureID = Convert.ToInt32(Request.QueryString["measureID"].ToString());

            Load_ICC(measureID);
            Load_Kappa(measureID);
        }
    }
예제 #12
0
 private void Page_Load(object sender, System.EventArgs e)
 {
     Log.Log.WriteToLog("TestSessionIIForm::Page_Load(): Session[\"SmthValue\"]=" + (Session["SmthValue"] != null ? "\"" + ((bool)Session["SmthValue"]).ToString().ToLower() + "\"" : "null") + " (IsPostBack=\"" + IsPostBack.ToString().ToLower() + "\", Session.SessionID: " + Session.SessionID + ")", true);
     LabelLoad.Text += DateTime.Now.ToString("dd.MM.yyyy hh:mm:ss.fffffff tt") + " (IsPostBack=\"" + IsPostBack.ToString().ToLower() + "\")<br>";
 }
예제 #13
0
 private void btnSubmit_Click(object sender, EventArgs e)
 {
     Log.Log.WriteToLog("TestSessionIIForm::btnSubmit_Click(): Session[\"SmthValue\"]=" + (Session["SmthValue"] != null ? "\"" + ((bool)Session["SmthValue"]).ToString().ToLower() + "\"" : "null") + " (IsPostBack=\"" + IsPostBack.ToString().ToLower() + "\", Session.SessionID: " + Session.SessionID + ")", true);
 }
예제 #14
0
 protected void Page_Load(object sender, EventArgs e)
 {
     LabelInfo.Text = "Page_Load IsPostBack=\"" + IsPostBack.ToString().ToLower() + "\"";
 }
예제 #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.ClientScript.RegisterClientScriptBlock(GetType(), "isPostBack", String.Format("var isPostback = {0};", IsPostBack.ToString().ToLower()), true);

            UserPages.Visible = false;

            if (Session["Cart"] == null)
            {
                Session["Cart"] = new OrderObject();
            }

            if (Session["User"] != null)
            {
                UserObject user = userDal.GetUserById((int)Session["User"]);

                UserPages.Visible = true;
                login.Visible     = false;
                label_user.Text   = $"Välkommen tillbaka {user.firstName}";
                pricegroup        = user.priceGroup;
            }



            if (!IsPostBack)
            {
                Pages pageDal = new Pages();

                foreach (PageObject page in pageDal.ListAllPagesList())
                {
                    if (page.name != "Startpage" && page.name != "Start" && page.name != "Erbjudande")
                    {
                        pageMeny.InnerHtml += $"<li><a href=\"page.aspx?id={page.pageId}\">{page.name}</a></li>";
                    }
                }

                Brand brandDal = new Brand();

                foreach (BrandObject brand in brandDal.ListAllBrandsList())
                {
                    brandMenu.InnerHtml += $"<li><a href=\"brand.aspx?id={brand.brandID}\">{brand.name}</a></li>";
                }
                brandMenu.InnerHtml += $"<li role = \"separator\" class=\"divider\" ></li><li><a href = \"brand.aspx\" >Alla</a></li>";

                Category categoryDal = new Category();

                foreach (CategoryObject category in categoryDal.ListAllCategoryList())
                {
                    categoryMenu.InnerHtml += $"<li><a href=\"category.aspx?id={category.categoryID}\">{category.name}</a></li>";
                }
                categoryMenu.InnerHtml += $"<li role =\"separator\" class=\"divider\" ></li><li><a href = \"category.aspx\" >Alla</a></li>";
            }

            HiddenField hdnID = (HiddenField)Page.Master.FindControl("Cart");


            BuildCart();
        }
예제 #16
0
 private void Page_Load(object sender, System.EventArgs e)
 {
     LabelInfo.Text = DateTime.Now.ToString("dd.MM.yyyy HH:mm:ss.ffff") + " (IsPostBack=" + IsPostBack.ToString().ToLower() + ")";
 }
예제 #17
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Log.Log.WriteToLog(string.Format("WebUserControl1.Page_Load() (IsPostBack: {0})", IsPostBack.ToString().ToLower()), true);
 }
예제 #18
0
        private void Page_Init(object sender, System.EventArgs e)
        {
            LabelInit.Text   += DateTime.Now.ToString("dd.MM.yyyy hh:mm:ss.fffffff tt") + " (IsPostBack=\"" + IsPostBack.ToString() + "\")<br>";
            TextBoxSrc2.Value = DateTime.Now.ToString("dd.MM.yyyy hh:mm:ss");

            int
                SmthVariable = 0;

            if (Session["SmthVariable"] != null)
            {
                SmthVariable = Convert.ToInt32(Session["SmthVariable"]);
            }

            Session["SmthVariable"] = ++SmthVariable;

            Log.Log.WriteToLog(LabelInit.Text, true);

            if (IsPostBack && this.FindControl(InputDynamicId) == null)
            {
                TextBox
                    tmpTextBox = new TextBox();

                tmpTextBox.ID = InputDynamicId;
                SpanForInputDynamic.Controls.Add(tmpTextBox);
            }
        }
예제 #19
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            LabelLoad.Text += DateTime.Now.ToString("dd.MM.yyyy hh:mm:ss.fffffff tt") + " (IsPostBack=\"" + IsPostBack.ToString() + "\") SmthVariable=" + Convert.ToInt32(Session["SmthVariable"]) + "<br>";

            if (IsPostBack)
            {
                TextBox
                    tmpTextBox;

                if ((tmpTextBox = this.FindControl(InputDynamicId) as TextBox) != null)
                {
                    tmpTextBox.Text += tmpTextBox.Text;
                }

                AccessToApplication.AccessToApplication.Applications = Application;
                AccessToApplication.AccessToApplication.IsUserOnlineExists();
            }
        }
예제 #20
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            int
                i;

            string
                tmpString;

            if (!IsPostBack)
            {
                string
                    StrVarDef  = "",
                    StrVarInit = "";

                if (StrVarInit.Length != 0)
                {
                    StrVarInit += ";";
                }
                StrVarInit += InsuredPersonCountMaxName + "=4";
                StrVarDef   = "var " + StrVarDef;
                StrVarInit += ";";
                VarDef.Text = StrBeginJS + StrVarDef + StrVarInit + StrEndJS;

                LabelOnLoadInfo.Text += "Page_Load(): " + DateTime.Now + " (IsPostBack=\"" + IsPostBack.ToString() + "\")<br>";
            }
            else
            {
                TableInfo.Clear();

                string[]
                rowInfo;

                TableInfoRow
                    r = new TableInfoRow();

                for (i = 1; i <= 4; ++i)
                {
                    rowInfo = Request.Params.GetValues("InputId" + i.ToString());
                    if (rowInfo == null)
                    {
                        continue;
                    }
                    if (rowInfo.Length != 0)
                    {
                        r.Id = Server.HtmlEncode(rowInfo[0]);
                    }

                    rowInfo = Request.Params.GetValues("InputSeria" + i.ToString());
                    if (rowInfo == null)
                    {
                        continue;
                    }
                    if (rowInfo.Length != 0)
                    {
                        r.Seria = Server.HtmlEncode(rowInfo[0]);
                    }

                    rowInfo = Request.Params.GetValues("InputNo" + i.ToString());
                    if (rowInfo == null)
                    {
                        continue;
                    }
                    if (rowInfo.Length != 0)
                    {
                        r.No = Server.HtmlEncode(rowInfo[0]);
                    }

                    rowInfo = Request.Params.GetValues("InputDate" + i.ToString());
                    if (rowInfo == null)
                    {
                        continue;
                    }
                    if (rowInfo.Length != 0)
                    {
                        r.Date = Server.HtmlEncode(rowInfo[0]);
                    }

                    TableInfo.Add(new TableInfoRow(r));
                }

                TableRow
                    rr;

                TableCell
                    c;

                i = 1;
                foreach (TableInfoRow row in TableInfo)
                {
                    rr = new TableRow();

                    c         = new TableCell();
                    tmpString = row.FIO + "<input id=\"InputId" + i.ToString() + "\" name=\"InputId" + i.ToString() + "\" type=\"hidden\" value=\"" + row.Id + "\">";
                    c.Controls.Add(new LiteralControl(tmpString));
                    rr.Cells.Add(c);

                    c         = new TableCell();
                    tmpString = "<input id=\"InputSeria" + i.ToString() + "\" name=\"InputSeria" + i.ToString() + "\" type=\"text\" value=\"" + row.Seria + "\" style=\"width: 100%; \">";
                    c.Controls.Add(new LiteralControl(tmpString));
                    rr.Cells.Add(c);

                    c         = new TableCell();
                    tmpString = "<input id=\"InputNo" + i.ToString() + "\" name=\"InputNo" + i.ToString() + "\" type=\"text\" value=\"" + row.No + "\" style=\"width: 100%; \">";
                    c.Controls.Add(new LiteralControl(tmpString));
                    rr.Cells.Add(c);

                    c         = new TableCell();
                    tmpString = "<input id=\"InputDate" + i.ToString() + "\" name=\"InputDate" + i.ToString() + "\" type=\"text\" value=\"" + row.Date + "\" style=\"width: 100%; \">";
                    c.Controls.Add(new LiteralControl(tmpString));
                    rr.Cells.Add(c);

                    c         = new TableCell();
                    tmpString = "<input id=\"DelButt" + i.ToString() + "\" name=\"DellButt" + i.ToString() + "\" type=\"button\" value=\"Del(" + i + ")\" onclick=\"Del(" + i.ToString() + ")\" style=\"width: 100%; \">";
                    c.Controls.Add(new LiteralControl(tmpString));
                    rr.Cells.Add(c);

                    c         = new TableCell();
                    tmpString = "<input id=\"EditButt" + i.ToString() + "\" name=\"EditButt" + i.ToString() + "\" type=\"button\" value=\"Edit(" + i + ")\" onclick=\"Edit(" + i.ToString() + ")\" style=\"width: 100%; \">";
                    c.Controls.Add(new LiteralControl(tmpString));
                    rr.Cells.Add(c);

                    ASPTable.Rows.Add(rr);

                    ++i;
                }

                LabelOnLoadInfo.Text += "Page_Load(): " + DateTime.Now + " (IsPostBack=\"" + IsPostBack.ToString() + "\")<br>";
            }
        }
 private void Page_Load(object sender, System.EventArgs e)
 {
     LabelInfo.Text     = DateTime.Now.ToString() + " IsPostBack=\"" + IsPostBack.ToString().ToLower() + "\"";
     LabelTextBox2.Text = "\"" + TextBox2.Text.Trim() + "\"";
 }
예제 #22
0
 private void Page_Load(object sender, System.EventArgs e)
 {
     Log.Log.WriteToLog("TestFormAuthentication::LoginForm::Page_Load() (IsPostBack=" + IsPostBack.ToString().ToLower() + ")", true);
 }
예제 #23
0
 protected void Page_Load(object sender, EventArgs e)
 {
     IFrameDynamic.Attributes["src"] = "TestDynamicFrameHandler.ashx?By=" + RadioButtonList1.SelectedValue + "&SmthParam=" + IsPostBack.ToString().ToLower();
 }
예제 #24
0
 protected void Page_Load(object sender, EventArgs e)
 {
     LabelInfo.Text     = DateTime.Now + " IsPostBack=\"" + IsPostBack.ToString().ToLower() + "\"";
     LabelTextBox2.Text = "\"" + TextBox2.Text.Trim() + "\"";
     RequiredFieldValidatorTextBox3.Enabled = CheckBoxIsValidateTextBox3.Checked;
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     LabelInfo.Text = DateTime.Now.ToString() + " IsPostBack=" + IsPostBack.ToString().ToLower();
 }
예제 #26
0
 private void Smth_Click(object sender, EventArgs e)
 {
     LabelInfo.Text = DateTime.Now.ToString("dd.MM.yyyy HH:mm:ss.ffff") + " (IsPostBack=" + IsPostBack.ToString().ToLower() + ")";
 }
예제 #27
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            Response.Write("Response.Write#1<br>");
            ParagraphRequest.Text  = "";
            ParagraphRequest.Text += "Request.ApplicationPath: \"" + Request.ApplicationPath + "\"<br>";

            HttpBrowserCapabilities
                bc = Request.Browser;

            ParagraphRequest.Text += "<br>";
            ParagraphRequest.Text += "Browser Capabilities:<br>";
            ParagraphRequest.Text += "Type = " + bc.Type + "<br>";
            ParagraphRequest.Text += "Name = " + bc.Browser + "<br>";
            ParagraphRequest.Text += "Version = " + bc.Version + "<br>";
            ParagraphRequest.Text += "Major Version = " + bc.MajorVersion + "<br>";
            ParagraphRequest.Text += "Minor Version = " + bc.MinorVersion + "<br>";
            ParagraphRequest.Text += "Platform = " + bc.Platform + "<br>";
            ParagraphRequest.Text += "Is Beta = " + bc.Beta + "<br>";
            ParagraphRequest.Text += "Is Crawler = " + bc.Crawler + "<br>";
            ParagraphRequest.Text += "Is AOL = " + bc.AOL + "<br>";
            ParagraphRequest.Text += "Is Win16 = " + bc.Win16 + "<br>";
            ParagraphRequest.Text += "Is Win32 = " + bc.Win32 + "<br>";
            ParagraphRequest.Text += "Supports Frames = " + bc.Frames + "<br>";
            ParagraphRequest.Text += "Supports Tables = " + bc.Tables + "<br>";
            ParagraphRequest.Text += "Supports Cookies = " + bc.Cookies + "<br>";
            ParagraphRequest.Text += "Supports VB Script = " + bc.VBScript + "<br>";
            ParagraphRequest.Text += "Supports JavaScript = " + bc.JavaScript + "<br>";
            ParagraphRequest.Text += "Supports Java Applets = " + bc.JavaApplets + "<br>";
            ParagraphRequest.Text += "Supports ActiveX Controls = " + bc.ActiveXControls + "<br>";
            ParagraphRequest.Text += "CDF = " + bc.CDF + "<br>";
            ParagraphRequest.Text += "W3CDomVersion = " + bc.W3CDomVersion + "<br>";
            ParagraphRequest.Text += "<br>";

            ParagraphRequest.Text += "Request.CurrentExecutionFilePath: \"" + Request.CurrentExecutionFilePath + "\"<br>";
            ParagraphRequest.Text += "Request.FilePath: \"" + Request.FilePath + "\"<br>";
            ParagraphRequest.Text += "Request.HttpMethod: \"" + Request.HttpMethod + "\"<br>";
            ParagraphRequest.Text += "Request.IsAuthenticated: \"" + Request.IsAuthenticated + "\"<br>";
            ParagraphRequest.Text += "Request.IsSecureConnection: \"" + Request.IsSecureConnection + "\"<br>";

            string[]
            array1,
            array2;

            int
                i,
                ii;

            ParagraphRequest.Text += "<br>";
            ParagraphRequest.Text += "Request.Params.Count: \"" + Request.Params.Count + "\"<br>";
            array1 = Request.Params.AllKeys;
            for (i = 0; i < array1.Length; ++i)
            {
                ParagraphRequest.Text += "Key [" + Convert.ToString(i) + "]=" + Server.HtmlEncode(array1[i]) + "<br>";
                array2 = Request.Params.GetValues(array1[i]);
                for (ii = 0; ii < array2.Length; ++ii)
                {
                    ParagraphRequest.Text += "Value [" + Convert.ToString(ii) + "]=" + Server.HtmlEncode(array2[ii]) + "<br>";
                }
            }
            ParagraphRequest.Text += "<br>";

            ParagraphRequest.Text += "Request.Path: \"" + Request.Path + "\"<br>";
            ParagraphRequest.Text += "Request.PathInfo: \"" + Request.PathInfo + "\"<br>";
            ParagraphRequest.Text += "Request.PhysicalApplicationPath: \"" + Request.PhysicalApplicationPath + "\"<br>";
            ParagraphRequest.Text += "Request.PhysicalPath: \"" + Request.PhysicalPath + "\"<br>";

            ParagraphRequest.Text += "<br>";
            ParagraphRequest.Text += "Request.QueryString.Count: \"" + Request.QueryString.Count + "\"<br>";

            array1 = Request.QueryString.AllKeys;
            for (i = 0; i < array1.Length; ++i)
            {
                ParagraphRequest.Text += "Key [" + Convert.ToString(i) + "]=" + Server.HtmlEncode(array1[i]) + "<br>";
                array2 = Request.QueryString.GetValues(array1[i]);
                for (ii = 0; ii < array2.Length; ++ii)
                {
                    ParagraphRequest.Text += "Value [" + Convert.ToString(ii) + "]=" + Server.HtmlEncode(array2[ii]) + " (" + array2[ii] + ")<br>";
                }
            }
            ParagraphRequest.Text += "<br>";

            ParagraphRequest.Text += "Request.RawUrl: \"" + Request.RawUrl + "\"<br>";
            ParagraphRequest.Text += "Request.RequestType: \"" + Request.RequestType + "\"<br>";

            ParagraphRequest.Text += "<br>";
            ParagraphRequest.Text += "Request.ServerVariables.Count: \"" + Request.ServerVariables.Count + "\"<br>";

            array1 = Request.ServerVariables.AllKeys;
            for (i = 0; i < array1.Length; ++i)
            {
                ParagraphRequest.Text += "Key [" + Convert.ToString(i) + "]=" + Server.HtmlEncode(array1[i]) + "<br>";
                array2 = Request.ServerVariables.GetValues(array1[i]);
                for (ii = 0; ii < array2.Length; ++ii)
                {
                    ParagraphRequest.Text += "Value [" + Convert.ToString(ii) + "]=" + Server.HtmlEncode(array2[ii]) + "<br>";
                }
            }
            ParagraphRequest.Text += "<br>";

            ParagraphRequest.Text += "Request.Url.AbsolutePath: \"" + Request.Url.AbsolutePath + "\"<br>";
            ParagraphRequest.Text += "Request.Url.AbsoluteUri: \"" + Request.Url.AbsoluteUri + "\"<br>";
            ParagraphRequest.Text += "Request.Url.Authority: \"" + Request.Url.Authority + "\"<br>";
            ParagraphRequest.Text += "Request.Url.Fragment: \"" + Request.Url.Fragment + "\"<br>";
            ParagraphRequest.Text += "Request.Url.Host: \"" + Request.Url.Host + "\"<br>";
            ParagraphRequest.Text += "Request.Url.HostNameType: \"" + Request.Url.HostNameType + "\"<br>";
            ParagraphRequest.Text += "Request.Url.LocalPath: \"" + Request.Url.LocalPath + "\"<br>";
            ParagraphRequest.Text += "Request.Url.PathAndQuery: \"" + Request.Url.PathAndQuery + "\"<br>";

            string
                tmpString = Server.UrlDecode(Request.Url.PathAndQuery);

            tmpString = HttpUtility.UrlDecode(Request.Url.PathAndQuery);

            ParagraphRequest.Text += "Request.Url.Query: \"" + Request.Url.Query + "\"<br>";
            ParagraphRequest.Text += "Request.Url.Scheme: \"" + Request.Url.Scheme + "\"<br>";
            array1 = Request.Url.Segments;
            for (i = 0; i < array1.Length; ++i)
            {
                ParagraphRequest.Text += "Request.Url.Segments [" + Convert.ToString(i) + "]=" + array1[i] + "<br>";
            }
            ParagraphRequest.Text += "Request.Url.UserEscaped: \"" + Request.Url.UserEscaped.ToString() + "\"<br>";
            ParagraphRequest.Text += "Request.Url.UserInfo: \"" + Request.Url.UserInfo + "\"<br>";

            if (Request.UrlReferrer != null)
            {
                ParagraphRequest.Text += "<br>";
                ParagraphRequest.Text += "Request.UrlReferrer.AbsolutePath: \"" + Request.UrlReferrer.AbsolutePath + "\"<br>";
                ParagraphRequest.Text += "Request.UrlReferrer.AbsoluteUri: \"" + Request.UrlReferrer.AbsoluteUri + "\"<br>";
                ParagraphRequest.Text += "Request.UrlReferrer.Authority: \"" + Request.UrlReferrer.Authority + "\"<br>";
                ParagraphRequest.Text += "Request.UrlReferrer.Fragment: \"" + Request.UrlReferrer.Fragment + "\"<br>";
                ParagraphRequest.Text += "Request.UrlReferrer.Host: \"" + Request.UrlReferrer.Host + "\"<br>";
                ParagraphRequest.Text += "Request.UrlReferrer.HostNameType: \"" + Request.UrlReferrer.HostNameType + "\"<br>";
                ParagraphRequest.Text += "Request.UrlReferrer.LocalPath: \"" + Request.UrlReferrer.LocalPath + "\"<br>";
                ParagraphRequest.Text += "Request.UrlReferrer.PathAndQuery: \"" + Request.UrlReferrer.PathAndQuery + "\"<br>";
                ParagraphRequest.Text += "Request.UrlReferrer.Query: \"" + Request.UrlReferrer.Query + "\"<br>";
                ParagraphRequest.Text += "Request.UrlReferrer.Scheme: \"" + Request.UrlReferrer.Scheme + "\"<br>";
                array1 = Request.UrlReferrer.Segments;
                for (i = 0; i < array1.Length; ++i)
                {
                    ParagraphRequest.Text += "Request.UrlReferrer.Segments [" + Convert.ToString(i) + "]=" + array1[i] + "<br>";
                }
                ParagraphRequest.Text += "Request.UrlReferrer.UserEscaped: \"" + Request.UrlReferrer.UserEscaped.ToString() + "\"<br>";
                ParagraphRequest.Text += "Request.UrlReferrer.UserInfo: \"" + Request.UrlReferrer.UserInfo + "\"<br>";
            }

            ParagraphRequest.Text += "<br>";
            ParagraphRequest.Text += "Request.UserAgent: \"" + Request.UserAgent + "\"<br>";
            ParagraphRequest.Text += "Request.UserHostAddress: \"" + Request.UserHostAddress + "\"<br>";
            ParagraphRequest.Text += "Request.UserHostName: \"" + Request.UserHostName + "\"<br>";

            ParagraphRequest.Text += "<br>";
            ParagraphRequest.Text += "Request.UserLanguages.Length: \"" + Request.UserLanguages.Length + "\"<br>";
            array1 = Request.UserLanguages;
            for (i = 0; i < array1.Length; ++i)
            {
                ParagraphRequest.Text += "User Language [" + Convert.ToString(i) + "]=" + array1[i] + "<br>";
            }
            ParagraphRequest.Text += "<br>";

            ParagraphRequest.Text += "IsPostBack=" + IsPostBack.ToString().ToLower();

            Response.Write("Response.Write#2<br>");

            if (!IsPostBack)
            {
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            String
                arrName  = "MyArray",
                arrValue = "\"1\", \"2\", \"text\"";

            ClientScriptManager
                cs = Page.ClientScript;

            cs.RegisterArrayDeclaration(arrName, arrValue);

            TextBox
                tmpTextBox;

            if ((tmpTextBox = PlaceHolderTextBox.FindControl(DynamicTextBoxSignature) as TextBox) != null)
            {
                LabelInfo.Text = "\"" + tmpTextBox.Text + "\" Page_Load IsPostBack=\"" + IsPostBack.ToString().ToLower() + "\"";
            }

            Button
                tmpButton = new Button();

            tmpButton.ID     = DynamicButtonSignature;
            tmpButton.Text   = DynamicButtonSignature;
            tmpButton.Click += new EventHandler(DynamicButton_Click);
            PlaceHolderTextBox.Controls.Add(tmpButton);
        }
예제 #29
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            Log.Log.WriteToLog("FrameForm2.Page_Load() (IsPostBack=\"" + IsPostBack.ToString() + "\")", true);

            string
                tmpString = string.Empty;

            if (!IsPostBack)
            {
                if (Request.QueryString.GetValues("IsPostBack") != null)
                {
                    tmpString = Request.QueryString.GetValues("IsPostBack")[0];
                    if (tmpString.ToLower() == "true")
                    {
                        if (Session["FrameForm2TextBoxInput1"] != null)
                        {
                            FrameForm2TextBoxInput1.Text = (string)Session["FrameForm2TextBoxInput1"];
                        }
                        if (Session["FrameForm2TextBoxInput2"] != null)
                        {
                            FrameForm2TextBoxInput2.Text = (string)Session["FrameForm2TextBoxInput2"];
                        }
                    }
                }
            }
            else
            {
                Session["FrameForm2TextBoxInput1"] = FrameForm2TextBoxInput1.Text;
                Session["FrameForm2TextBoxInput2"] = FrameForm2TextBoxInput2.Text;

                if (tmpString != string.Empty)
                {
                    tmpString += Environment.NewLine;
                }
                tmpString += "FrameForm2TextBoxInput1.Text=\"" + FrameForm2TextBoxInput1.Text + "\"";

                if (tmpString != string.Empty)
                {
                    tmpString += Environment.NewLine;
                }
                tmpString += "FrameForm2TextBoxInput2.Text=\"" + FrameForm2TextBoxInput2.Text + "\"";

                DataRow
                    row;

                Log.Log.WriteToLog("FrameForm2.Page_Load() before lock (IsPostBack=\"" + IsPostBack.ToString() + "\")", true);
                lock (TestDSVariable)
                {
                    Log.Log.WriteToLog("FrameForm2.Page_Load() in lock (IsPostBack=\"" + IsPostBack.ToString() + "\")", true);

                    if (TestDSVariable.Tables["TestTable"].Rows.Count == 0)
                    {
                        row = TestDSVariable.Tables["TestTable"].NewRow();
                    }
                    else
                    {
                        row = TestDSVariable.Tables["TestTable"].Rows[0];
                    }

                    long
                        tmpLong;

                    try
                    {
                        tmpLong = Convert.ToInt64(FrameForm2TextBoxInput1.Text);
                    }
                    catch (FormatException)
                    {
                        tmpLong = long.MinValue;
                    }
                    tmpString = "FrameForm2TextBoxInput1";
                    if (tmpLong != long.MinValue)
                    {
                        row[tmpString] = tmpLong;
                    }
                    else
                    {
                        row[tmpString] = DBNull.Value;
                    }

                    try
                    {
                        tmpLong = Convert.ToInt64(FrameForm2TextBoxInput2.Text);
                    }
                    catch (FormatException)
                    {
                        tmpLong = long.MinValue;
                    }
                    tmpString = "FrameForm2TextBoxInput2";
                    if (tmpLong != long.MinValue)
                    {
                        row[tmpString] = tmpLong;
                    }
                    else
                    {
                        row[tmpString] = DBNull.Value;
                    }

                    if (row.RowState == DataRowState.Detached)
                    {
                        TestDSVariable.Tables["TestTable"].Rows.Add(row);
                    }

                    if (CheckBoxWithSleep.Checked)
                    {
                        Log.Log.WriteToLog("FrameForm2.Page_Load() before sleep (IsPostBack=\"" + IsPostBack.ToString() + "\")", true);
                        Thread.Sleep(TestDS.SleepTime);
                        Log.Log.WriteToLog("FrameForm2.Page_Load() after sleep (IsPostBack=\"" + IsPostBack.ToString() + "\")", true);
                    }
                }
            }
        }
예제 #30
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            string
                _tmpString_ = "This is a <Test String>.";

            _tmpString_ = Server.HtmlEncode(_tmpString_);          // -> "This is a &lt;Test String&gt;."
            _tmpString_ = Server.HtmlDecode(_tmpString_);          // -> "This is a <Test String>."

            _tmpString_ = HttpUtility.HtmlEncode(_tmpString_);     // -> "This is a &lt;Test String&gt;."
            _tmpString_ = HttpUtility.HtmlDecode(_tmpString_);     // -> "This is a <Test String>."

            _tmpString_ = Server.UrlEncode(_tmpString_);           // -> "This+is+a+%3cTest+String%3e."
            _tmpString_ = Server.UrlDecode(_tmpString_);           // -> "This is a <Test String>."

            _tmpString_ = HttpUtility.UrlEncode(_tmpString_);      // -> "This+is+a+%3cTest+String%3e."
            _tmpString_ = HttpUtility.UrlDecode(_tmpString_);      // -> "This is a <Test String>."

            _tmpString_ = "Это - тест <\"ПрЫвЭт!!!\">";

            _tmpString_ = Server.HtmlEncode(_tmpString_);
            _tmpString_ = Server.HtmlDecode(_tmpString_);

            _tmpString_ = HttpUtility.HtmlEncode(_tmpString_);
            _tmpString_ = HttpUtility.HtmlDecode(_tmpString_);

            _tmpString_ = Server.UrlEncode(_tmpString_);
            _tmpString_ = Server.UrlDecode(_tmpString_);

            _tmpString_ = HttpUtility.UrlEncode(_tmpString_);
            _tmpString_ = HttpUtility.UrlDecode(_tmpString_);

            _tmpString_ = "Привет";

            _tmpString_ = Server.UrlEncode(_tmpString_);
            _tmpString_ = Server.UrlDecode(_tmpString_);

            _tmpString_ = HttpUtility.UrlEncode(_tmpString_);
            _tmpString_ = HttpUtility.UrlDecode(_tmpString_);

            _tmpString_ = "При\nвет\r\n";

            _tmpString_ = Server.UrlEncode(_tmpString_);
            _tmpString_ = Server.UrlDecode(_tmpString_);

            _tmpString_ = HttpUtility.UrlEncode(_tmpString_);
            _tmpString_ = HttpUtility.UrlDecode(_tmpString_);

            _tmpString_  = Request.Url.Scheme;
            _tmpString_ += Uri.SchemeDelimiter;
            _tmpString_ += Request.Url.Host;
            _tmpString_ += Request.Url.IsDefaultPort ? string.Empty : ":" + Request.Url.Port;
            _tmpString_ += ResolveUrl("~/MainTitle.aspx");

            LabelPage.Text += "PageLoad: " + DateTime.Now.ToString("hh:mm:ss") + " (IsPostBack=\"" + IsPostBack.ToString() + "\")<br>";
            if (!IsPostBack)
            {
                LabelEnvironmentCurrentDirectory.Text += Environment.CurrentDirectory;

                IEnumerator
                    keys = TestDiv.Style.Keys.GetEnumerator();

                String
                    key;

                while (keys.MoveNext())
                {
                    key = (String)keys.Current;
                    DivLabelInfo.Text += "[" + key + "]=" + TestDiv.Style[key] + "<br>";
                }

                TextBox1.ToolTip      = "Line 1\nLine 2";
                LabelApplication.Text = String.Format("User Online={0}", (int)(Application["UserOnline"]));

                MainTable.Border = 3;

                TableRow
                    row;

                TableCell
                    cell;

                int
                    i;

                for (i = 0; i < 2; ++i)
                {
                    row = new TableRow();
                    for (int j = 0; j < 2; ++j)
                    {
                        cell      = new TableCell();
                        cell.Text = String.Format("Row {0}, Column {1}", i + 1, j + 1);
                        row.Cells.Add(cell);
                    }
                    Table2.Rows.Add(row);
                }

                DateTime
                    date;

                for (i = 0; i < 5; ++i)
                {
                    date = DateTime.Today + new TimeSpan(i, 0, 0, 0);
                    DropDownListDate.Items.Add(date.ToString("MMMM dd, yyyy"));
                }

                DataSet
                    ds = new DataSet();

                ds.ReadXml(Server.MapPath("data/rates.xml"));
                ListBox2.DataSource     = ds;
                ListBox2.DataTextField  = "Currency";
                ListBox2.DataValueField = "Exchange";
                ListBox2.DataBind();
                ListBox2.SelectedIndex = 3;

                Cell11.BorderColor = "red";
                Cell11.BgColor     = "green";

                for (i = 100; i <= 1000; i += 100)
                {
                    TableDropDownList.Items.Add(i.ToString());
                }

                ArrayList
                    a = new ArrayList();

                for (i = 50; i <= 1000; i += 50)
                {
                    a.Add(i.ToString());
                }
                TableListBox.DataSource = a;
                TableListBox.DataBind();

                string[]
                beatles = { "John", "Paul", "George", "Ringo" };

                ListBoxAdd1.DataSource = beatles;
                ListBoxAdd1.DataBind();

                ListBoxAdd2.DataSource = new Beatles();
                ListBoxAdd2.DataBind();

                DropDownListTestDataBind.DataSource     = new BeatlesII();
                DropDownListTestDataBind.DataTextField  = "Name";
                DropDownListTestDataBind.DataValueField = "Id";
                DropDownListTestDataBind.DataBind();

                DropDownListTestDataBindII.DataSource     = new BeatlesII();
                DropDownListTestDataBindII.DataValueField = "Name";
                DropDownListTestDataBindII.DataTextField  = "Id";
                DropDownListTestDataBindII.DataBind();

                ImageButton4.Attributes["onclick"] = "return(confirm('Submit?'));";
                ImageButton5.Attributes["onclick"] = "return(false);";

                ListBox1.Attributes.Add("ondblclick", "alert('ondblclick');");
                DropDownListDate.Attributes.Add("ondblclick", "alert('ondblclick');");

                Button3.Attributes.Add("onclick", "alert('ковычки \u0022');");

                DataTable
                    SmthTable = new DataTable();

                string
                    SmthFieldName = "Id";

                SmthTable.Columns.Add(SmthFieldName, typeof(int));

                DataRow
                    tmpDataRow = SmthTable.NewRow();

                tmpDataRow[SmthFieldName] = 1;
                SmthTable.Rows.Add(tmpDataRow);

                tmpDataRow = SmthTable.NewRow();
                tmpDataRow[SmthFieldName] = 2;
                SmthTable.Rows.Add(tmpDataRow);

                tmpDataRow = SmthTable.NewRow();
                tmpDataRow[SmthFieldName] = 3;
                SmthTable.Rows.Add(tmpDataRow);

                string
                    tmpString = String.Empty;

                foreach (DataRow _row_ in SmthTable.Rows)
                {
                    if (tmpString != String.Empty)
                    {
                        tmpString += ",";
                    }
                    tmpString += !_row_.IsNull(SmthFieldName) ? "\"" + Convert.ToString(_row_[SmthFieldName]).Replace("\\", "\\\\").Replace("\"", "\\\"") + "\"" : "null";
                }
                VarDef.Text  = "\n<script type=\"text/javascript\">\n<!--\n";
                VarDef.Text += "ArrayName=[" + tmpString + "];";
                VarDef.Text += "\n// -->\n</script>";

                Button4.Attributes.Add("onclick", "return(confirm('ahha?\\r\\nahha?'));");
            }
            else
            {
                LabelTextBoxReadOnly.Text = TextBoxReadOnly.Text;

                string
                    tmpString = TextBox3.Text;

                if ((tmpString.IndexOf("\r\n")) != -1)
                {
                    tmpString = tmpString.Replace("\r\n", " ").Trim();
                }

                TextBox3.Text = tmpString;

                lock (typeof(TestClassWithStatic))
                {
                    LabelStaticValue.Text = Convert.ToString(TestClassWithStatic.Counter) + "->" + Convert.ToString(--TestClassWithStatic.Counter) + " (SessionID: " + Session.SessionID + ")";
                }

                TextBox
                    TextBoxInput,
                    TextBoxOutput;

                if ((TextBoxInput = NewDynamicTable.FindControl("TextBoxInput__0") as TextBox) != null &&
                    (TextBoxOutput = NewDynamicTable.FindControl("TextBoxOutput__0") as TextBox) != null)
                {
                    TextBoxOutput.Text = TextBoxInput.Text;
                }
                else if ((TextBoxInput = NewDynamicTable.Rows[0].FindControl("TextBoxInput__0") as TextBox) != null &&
                         (TextBoxOutput = NewDynamicTable.Rows[0].FindControl("TextBoxOutput__0") as TextBox) != null)
                {
                    TextBoxOutput.Text = TextBoxInput.Text;
                }
                else if ((TextBoxInput = NewDynamicTable.Rows[0].Cells[0].FindControl("TextBoxInput__0") as TextBox) != null &&
                         (TextBoxOutput = NewDynamicTable.Rows[0].Cells[0].FindControl("TextBoxOutput__0") as TextBox) != null)
                {
                    TextBoxOutput.Text = TextBoxInput.Text;
                }
                for (int row = 0; row < NewDynamicTable.Rows.Count; ++row)
                {
                    for (int col = 0; col < NewDynamicTable.Rows[row].Cells.Count; ++col)
                    {
                        if ((TextBoxInput = NewDynamicTable.Rows[row].Cells[col].FindControl("TextBoxInput__" + row) as TextBox) != null &&
                            (TextBoxOutput = NewDynamicTable.Rows[row].Cells[col].FindControl("TextBoxOutput__" + row) as TextBox) != null)
                        {
                            TextBoxOutput.Text = TextBoxInput.Text;
                        }
                    }
                }

                #region DropDownListEnabledDisabled
                DropDownListEnabledDisabled.Enabled = Request.Form.GetValues("DropDownListEnabledDisabled") != null;

                string[]
                ParamArray = Request.Form.GetValues("DropDownListEnabledDisabled");

                string
                    ParamValue = string.Empty;

                if (ParamArray != null && ParamArray.Length > 0)
                {
                    ParamValue = ParamArray[0];
                }

                LabelDropDownListEnabledDisabled.Text = ParamValue;
                #endregion

                #region Test __doPostBack()
                tmpString = Request.Form["__EVENTTARGET"];
                tmpString = Request.Form["__EVENTARGUMENT"];
                #endregion
            }

            #region System.Web.UI.WebControls.Literal
            if (LiteralWOVS.EnableViewState)
            {
                LiteralWOVS.EnableViewState = false;
            }

            if (!IsPostBack)
            {
                LiteralWVS.Text  = "<!-- LiteralWVS -->";
                LiteralWOVS.Text = "<!-- LiteralWOVS -->";
            }
            else
            {
                _tmpString_ = "\"" + LiteralWVS.Text + "\"";
                if (_tmpString_ != string.Empty)
                {
                    _tmpString_ += Environment.NewLine;
                }
                _tmpString_ = "\"" + LiteralWOVS.Text + "\"";
            }
            #endregion
        }