/// <summary> /// When the page is loaded, unobtrusive validation is turned off. /// If the page is being loaded for the first time, it imports the information from the jersey options page and stores it in a session variable. /// In addition, it displays the jersey configuration to the user. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { UnobtrusiveValidationMode = UnobtrusiveValidationMode.None; if (!IsPostBack) { //breates a variable indicating that the customer is new. Session["IsExistingCustomer"] = false; DropDownList ddlTeamName = (DropDownList)PreviousPage.FindControl("ddlTeamNames"); Session["SelectedTeamID"] = ddlTeamName.SelectedItem.Value; DropDownList ddlJerseyColor = (DropDownList)PreviousPage.FindControl("ddlColor"); Session["SelectedColorID"] = ddlJerseyColor.SelectedItem.Value; DropDownList ddlJerseySize = (DropDownList)PreviousPage.FindControl("ddlSize"); Session["SelectedSizeID"] = ddlJerseySize.SelectedItem.Value; Label lblJerseyPrice = (Label)PreviousPage.FindControl("lblPrice"); DropDownList ddlJerseyNumber = (DropDownList)PreviousPage.FindControl("ddlNumber"); Session["SelectedJerseyNumber"] = ddlJerseyNumber.SelectedItem.Value; TextBox txtJerseyName = (TextBox)PreviousPage.FindControl("txtJerseyName"); lblTeamName.Text = ddlTeamName.SelectedItem.Text; lblJerseyNumber.Text = ddlJerseyNumber.Text; lblJerseyName.Text = txtJerseyName.Text; lblJerseySize.Text = ddlJerseySize.SelectedItem.Text; lblPrice.Text = lblJerseyPrice.Text; lblJerseyColor.Text = ddlJerseyColor.SelectedItem.Text; } }
string GetInitiatingDepartment() { string initiatingDepartment = ""; var initiatingDepartmentPrimary = PreviousPage.FindControl("ddlInitiatingDepartment") as DropDownList; var initiatingDepartmentSub = PreviousPage.FindControl("ddlSubDepartments") as DropDownList; var initiatingDepartmentOther = PreviousPage.FindControl("txtOtherInitiatingDepartment") as TextBox; string strInitiatingDepartmentPrimary = GetInitiatingDepartmentPrimary(Convert.ToInt16(initiatingDepartmentPrimary.Text)); if (strInitiatingDepartmentPrimary == "Administration" || strInitiatingDepartmentPrimary == "MX" || strInitiatingDepartmentPrimary == "Operations") { initiatingDepartment = GetInitiatingDepartmentSub(Convert.ToInt16(initiatingDepartmentSub.Text)); } else if (initiatingDepartmentPrimary.Text == "Other") { initiatingDepartment = initiatingDepartmentOther.Text; } else { initiatingDepartment = strInitiatingDepartmentPrimary; } return(initiatingDepartment); }
protected void Page_Load(object sender, EventArgs e) { if (PreviousPage != null) { TextBox txtSearch = (TextBox)PreviousPage.FindControl("TextBox4"); lblSearch.Text = txtSearch.Text; } SqlConnection conn = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=" + Server.MapPath("~\\App_Data\\mydatabase.mdf") + ";Integrated Security=True"); GridView1.DataSourceID = ""; String query = "select * from utilisateur where (nom like '%' + @search + '%')"; SqlCommand sr = new SqlCommand(query, conn); sr.Parameters.Add("@search", SqlDbType.NVarChar).Value = lblSearch.Text; conn.Open(); sr.ExecuteNonQuery(); SqlDataAdapter da = new SqlDataAdapter(); da.SelectCommand = sr; DataSet ds = new DataSet(); da.Fill(ds, "nom"); GridView1.DataSource = ds; GridView1.DataBind(); conn.Close(); }
protected void Page_Load(object sender, EventArgs e) { if (PreviousPage != null) { TextBox txt = (TextBox)PreviousPage.FindControl("txt"); Label1.Text = txt.Text; } RadioButton r1 = (RadioButton)PreviousPage.FindControl("r1"); RadioButton r2 = (RadioButton)PreviousPage.FindControl("r2"); RadioButton r3 = (RadioButton)PreviousPage.FindControl("r3"); if (r1.Checked == true || r2.Checked == true || r3.Checked == true) { if (r1.Checked == true) { Label2.Text = " Quelconque "; } else if (r2.Checked == true) { Label2.Text = " Moyenne "; } else { Label2.Text = " Excellente "; } } }
protected void Page_Load(object sender, EventArgs e) { string ht = Request.Form["ht"]; string gt = Request.Form["gt"]; string que = Request.Form["que"]; string mh = Request.Form["mh"]; //string ht = Request.QueryString["ht"]; //string gt = Request.QueryString["gt"]; //string que = Request.QueryString["que"]; //string mh = Request.QueryString["mh"]; Response.Write("<h2>Bạn vừa gửi đi thông tin:</h2>"); Response.Write("Họ tên:" + ht + "<br />"); Response.Write("Giới tính:" + gt + "<br />"); Response.Write("Quê quán:" + que + "<br />"); Response.Write("Môn học:" + mh + "<br />"); //Nếu từ trang input2.aspx gửi sang thì CheckBoxList ck = (CheckBoxList)PreviousPage.FindControl("mh"); string s = ""; if (ck != null) { foreach (ListItem x in ck.Items) { if (x.Selected) { s += x.Text + " "; } } Response.Write("Môn học:" + s + "<br />"); } }
protected void Page_Load(object sender, EventArgs e) { TextBox Cash = (TextBox)PreviousPage.FindControl("TextBox1"); TextBox Rate = (TextBox)PreviousPage.FindControl("TextBox2"); Label1.Text = Convert.ToString(Convert.ToDouble(Cash.Text) + Convert.ToDouble(Cash.Text) * Convert.ToDouble(Rate.Text)); }
protected void Page_Load(object sender, EventArgs e) { //Session["SalesPrice"] = tbSalesPrice.Text; //Session["DiscountAmt"] = lblOutDiscAmt.Text; //Session["TotalPrice"] = lblOutPrice.Text; Page previousPage = this.Page.PreviousPage; if (previousPage != null) { TextBox tbSalesPrice = (TextBox)PreviousPage.FindControl("tbSalesPrice"); lblOutSalesPrice.Text = tbSalesPrice.Text; // if (tbSalesPrice.Text != null) //{ // lblOutSalesPrice.Text = tbSalesPrice.Text; // } Label lblOutDiscAmt = (Label)PreviousPage.FindControl("lblOutDiscAmt"); //if (lblOutDiscAmt.Text !=null) if (lblOutDiscAmt.Text != "") { lblOutDiscAmt1.Text = lblOutDiscAmt.Text; } // Label lblTotalPrice = (Label)PreviousPage.FindControl("lblOutPrice"); Label lblOutPrice = (Label)PreviousPage.FindControl("lblOutPrice"); lblOutPrice1.Text = lblOutPrice.Text; // if (lblOutPrice1.Text != null) //if (lblOutPrice1.Text != "") //{ // lblOutPrice1.Text = lblTotalPrice.Text; //} } }
protected void Page_Load(object sender, EventArgs e) { if (PreviousPage != null) { if (PreviousPage.IsCrossPagePostBack) { var title = PreviousPage.FindControl("TextBox1") as TextBox; var member = PreviousPage.FindControl("ListBox1") as ListBox; var time = PreviousPage.FindControl("Calendar1") as Calendar; if (title != null && member != null && time != null) { Label1.Text = title.Text; Label2.Text = ""; foreach (ListItem memberItem in member.Items) { if (memberItem.Selected) { Label2.Text += memberItem.Text + ","; } } Label3.Text = time.SelectedDate.ToLongDateString(); } } } }
protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { try { CommonClass cm = new CommonClass(); lblMessage.Text = " YOU HAVE SUCESSFULLY SUBMITTED YOUR INFORMATION.<br/> <br><br> 'Within 24-48 hours time you will receive an email directly from me, titled Your Free Reading from ZRox'which will contain your complete Free Astrological Reading.: "; TextBox txmail = (TextBox)PreviousPage.FindControl("txtEmail"); CommonClass mail = new CommonClass(); if (txmail != null && txmail.Text != "") { string to = txmail.Text.ToString(); string msg = "Welcome"; mail.SendMail("*****@*****.**", to, "Welcome in ZROX", msg); } } catch (Exception ex) { //Response.Redirect("Astrology_Confomation.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { try { if (!PreviousPage.IsValid) { labelResult.Text = "Error in previous page"; return; } //DropDownList dropDownListEvents = (DropDownList)PreviousPage.FindControl("dropDownListEvents"); //string selectedEvent = dropDownListEvents.SelectedValue; labelResult.Text = "1"; string firstName = ((TextBox)(PreviousPage.FindControl( "textFirstName"))).Text; labelResult.Text = "2"; string lastName = ((TextBox)(PreviousPage.FindControl( "textLastName"))).Text; labelResult.Text = "3"; string email = ((TextBox)(PreviousPage.FindControl( "textEmail"))).Text; labelResult.Text = "4"; //labelResult.Text = String.Format("{0} {1} selected the event",firstName, lastName); //RegistrationInfo ri = PreviousPage.RegistrationInfo; /*LabelResult.Text = String.Format("{0} {1} selected the event {2}", * ri.FirstName, ri.LastName, ri.SelectedEvent);*/ } catch { labelResult.Text = "The originating page must contain " + "textFirstName, textLastName, textEmail controls"; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string numNights = Convert.ToString((TextBox)PreviousPage.FindControl("txtNights").Text); string arrivalDate = Convert.ToString((TextBox)PreviousPage.FindControl("txtArrivalDate").Text); string numAdults = Convert.ToString((DropDownList)PreviousPage.FindControl("ddlAdults").SelectedValue); string numChildren = Convert.ToString((DropDownList)PreviousPage.FindControl("ddlChildren").SelectedValue); string roomTypeBusiness = "false"; string roomTypeSuite = "false"; string roomTypeStandard = "false"; string bedTypeKing = "false"; string bedTypeDouble = "false"; string smokingOption = "false"; if (Convert.ToBoolean((RadioButton)PreviousPage.FindControl("rdoBusiness).Checked")) roomTypeBusiness = "true"; else if (Convert.ToBoolean((RadioButton)PreviousPage.FindControl("rdoSuite").Checked")) roomTypeSuite = "true"; else roomTypeStandard = "true"; if (Convert.ToBoolean((RadioButton)PreviousPage.FindControl("rdoKing").Checked)) bedTypeKing = "true"; else bedTypeDouble = "true"; string specialRequests = Convert.ToString((TextBox)PreviousPage.FindControl("txtSpecialRequests").Text); string name = Convert.ToString((TextBox)PreviousPage.FindControl("txtName").Text); string email = Convert.ToString((TextBox)PreviousPage.FindControl("txtEmail").Text); lblResults.Text = String.Format("Arrival Date: {0} \r\n Number of Nights: {1} \n Number of Adults: \r {2} Number of Children: {3} Business Room: {4} Suite Room: {5} Standard Room: {6} King Bed: {7} Double Bed: {8} Smoking: {9} Special Requests: {10} Name: {11} E-mail: {12}", arrivalDate, numNights, numAdults, numChildren, roomTypeBusiness, roomTypeSuite, roomTypeStandard, bedTypeKing, bedTypeDouble, smokingOption, specialRequests, name, email); }
protected void Page_Load(object sender, EventArgs e) { if (PreviousPage != null) { TextBox xx = (TextBox)PreviousPage.FindControl("TextBox1"); lbl01.Text += "Voici les commentaires récupérés : " + xx.Text; } if (PreviousPage != null) { RadioButton x = (RadioButton)PreviousPage.FindControl("RadioButton1"); if (x.Checked == true) { lbl02.Text += "et vous avez classé l'image comme : " + x.Text; } } if (PreviousPage != null) { RadioButton x = (RadioButton)PreviousPage.FindControl("RadioButton2"); if (x.Checked == true) { lbl02.Text += "et vous avez classé l'image comme : " + x.Text; } } if (PreviousPage != null) { RadioButton x = (RadioButton)PreviousPage.FindControl("RadioButton3"); if (x.Checked == true) { lbl02.Text += "et vous avez classé l'image comme :" + x.Text; } } }
protected void Page_Load(object sender, EventArgs e) { //Writes information into the text box //txtVerifiedInfo.Text = Request["txtFirstName"] + //Return then Last Name // "\n" + Request["txtLastName"] + //Return then Pay Rate // "\n" + Request["txtPayRate"] + //Return then Start Date // "\n" + Request["txtStartDate"] + //Return then End Date // "\n" + Request["txtEndDate"]; //Declares the value for the string getting passed over string strVerifyInfo; //Setting the value for the declared string strVerifyInfo = PreviousPage.FindControl(txtFirstName); //txtVerifiedInfo.Text = Request["txtFirstName"]; // "\n" + Request["txtLastName"] + // "\n" + Request["txtPayRate"] + // "\n" + Request["txtStartDate"] + // "\n" + Request["txtEndDate"]; //Writes the information into the text box txtVerifiedInfo.Text = strVerifyInfo; }
protected void Page_Load(object sender, EventArgs e) { string username, pswd; //使用查询字符串传递页面间的数据 // username = this.Request.Params["username"]; // pswd = this.Request.Params["pswd"]; // username =Server.UrlDecode ( this.Request.Params["username"]); // pswd =Server.UrlDecode ( this.Request.Params["pswd"]); // 使用会话状态传递页面间的数据 // username =this.Session["username"].ToString () ; // pswd = this.Session["pswd"].ToString(); // 使用跨页提交功能 // 获取源页(登录页面)的控件值 TextBox textbox1, textbox2; textbox1 = (TextBox)PreviousPage.FindControl("txtUsername"); textbox2 = (TextBox)PreviousPage.FindControl("txtPassWord"); username = textbox1.Text; pswd = textbox2.Text; this.Response.Write(username + "您好!欢迎您访问本网站;您的密码为:" + pswd); }
protected void Page_Load(object sender, EventArgs e) { TextBox tx1, tx2; tx1 = (TextBox)PreviousPage.FindControl("TextBox1"); tx2 = (TextBox)PreviousPage.FindControl("TextBox2"); DropDownList eduactional = (DropDownList)PreviousPage.FindControl("DropDownList1"); RadioButtonList gender = (RadioButtonList)PreviousPage.FindControl("RadioButtonList1"); CheckBoxList interest = (CheckBoxList)PreviousPage.FindControl("CheckBoxList1"); DropDownList profession = (DropDownList)PreviousPage.FindControl("DropDownList2"); Label1.Text = tx1.Text; Label2.Text = gender.SelectedItem.Text; Label3.Text = eduactional.SelectedItem.Text; Label4.Text = profession.SelectedItem.Text; foreach (ListItem i in interest.Items) { if (i.Selected) { Label5.Text += i.Text + " "; } } Label6.Text = tx2.Text; }
protected void Page_Load(object sender, EventArgs e) { string str_Info = "PreviousPage: "; str_Info += PreviousPage != null ? "true" : "false"; str_Info += "<br />"; str_Info += "IsCrossPagePostBack: "; if (PreviousPage != null) { str_Info += PreviousPage.IsCrossPagePostBack ? "true" : "false"; if (PreviousPage.IsCrossPagePostBack) { TextBox tb = (TextBox)PreviousPage.FindControl("tb_1"); lab_2.Text = tb.Text; Label lb = (Label)PreviousPage.FindControl("lab_1"); lab_3.Text = lb.Text; } } else { str_Info += "false"; } lab_1.Text = str_Info; }
protected void Page_Load(object sender, EventArgs e) { if (Page.PreviousPage != null && Page.PreviousPage.IsValid) { // Get the value of UserName and Token from the page that posted to this page. string userName = ((TextBox)PreviousPage.FindControl("_tbUserName")).Text; // If user name was specified, use it as the user token. if (!string.IsNullOrEmpty(userName)) { _hiddenFieldClientMetadata.Value = userName; } } if (!IsPostBack) { // Enumerate the source files and conversion profiles on the server path EnumerateURLSourceFiles(); EnumerateProfiles(); Session["tblSelected"] = null; // Initially sort the jobs list by their added Date/Time ViewState["SortExpression"] = "Added Data/Time"; GetClientJobs(); } UpdateUIState(); }
protected void Page_Load(object sender, EventArgs e) { if (PreviousPage != null && PreviousPage.IsCrossPagePostBack) { DropDownList depart = PreviousPage.FindControl("DropDownList2") as DropDownList; DropDownList destination = PreviousPage.FindControl("DropDownList3") as DropDownList; Label distance = PreviousPage.FindControl("Label1") as Label; Label duration = PreviousPage.FindControl("Label3") as Label; TextBox email = PreviousPage.FindControl("TextBox2") as TextBox; txtEmail.Text = email.Text; Label member = PreviousPage.FindControl("lblEmail") as Label; TextBox date = PreviousPage.FindControl("TextBox1") as TextBox; DropDownList time1 = PreviousPage.FindControl("DropDownList4") as DropDownList; DropDownList time2 = PreviousPage.FindControl("DropDownList5") as DropDownList; DropDownList time3 = PreviousPage.FindControl("DropDownList6") as DropDownList; Label2.Text = depart.SelectedValue; Label3.Text = destination.SelectedValue; Label4.Text = date.Text; Label5.Text = time1.SelectedValue + ":" + time2.SelectedValue + " " + time3.SelectedValue; Label6.Text = distance.Text + " KM"; Label9.Text = time1.SelectedValue; Label10.Text = time2.SelectedValue; Label12.Text = time1.SelectedValue + "." + time2.SelectedValue; GridView1.Load += GridView1_Load; } }
protected void Page_Load(object sender, EventArgs e) { { if (!IsPostBack) { BindData(); } } if (PreviousPage != null) { TextBox SourceTextBox = (TextBox)PreviousPage.FindControl("LastName"); if (SourceTextBox != null) { label1.Text = SourceTextBox.Text; } } if (PreviousPage != null) { TextBox SourceTextBox = (TextBox)PreviousPage.FindControl("FirstMidName"); if (SourceTextBox != null) { label1.Text = SourceTextBox.Text; } } }
protected void Page_Load(object sender, EventArgs e) { Label1.Text = "用户名:" + PreviousPage.Name + "<br/>密 码:"; TextBox pw = (TextBox)PreviousPage.FindControl("TextBox2"); Label1.Text += pw.Text + "<br/>"; }
protected void Page_Load(object sender, EventArgs e) { if (PreviousPage != null && PreviousPage.IsCrossPagePostBack) { var txt = PreviousPage.FindControl("txtName") as TextBox; if (null != txt) { lblName.Text = txt.Text; } return; } if (IsPostBack) { return; } if (PreviousPage == null) { return; } var txtName = PreviousPage.FindControl("txtName") as TextBox; if (null != txtName) { lblName.Text = txtName.Text; } lblId.Text = PreviousPage.Request.QueryString["SN"]; }
protected void Page_Load(object sender, EventArgs e) { string key; key = ((DropDownList)PreviousPage.FindControl("DropDownList1")).Text; string startdatum, slutdatum; startdatum = ((TextBox)PreviousPage.FindControl("DateTextBox")).Text; slutdatum = ((TextBox)PreviousPage.FindControl("DateTextBox1")).Text; Label1.Text = startdatum; Label3.Text = slutdatum; Label2.Text = key; //Data Source=Data Source=(LocalDB)\v11.0;AttachDbFilename="C:\Users\Anders\Documents\Visual Studio 2013\WebSites\WebSite5\App_Data\SJ.mdf";Integrated Security=True;Connect Timeout=30 SqlConnection conn; string connectionString = @"Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|/SJ.mdf;Integrated Security=True;Connect Timeout=30"; conn = new SqlConnection(connectionString); try{ conn.Open(); Label3.Text = "Data connection is open.."; conn.Close(); } catch (Exception ex) { Label2.Text = "Failed to open.."; Label3.Text = ex.ToString(); } }
protected void Page_Load(object sender, EventArgs e) { if (PreviousPage != null && PreviousPage.IsCrossPagePostBack && PreviousPage.IsValid) { TextBox ppTextBox1 = (TextBox)PreviousPage.FindControl("TextBox1"); Label1.Text = "Hello " + ppTextBox1.Text + "</br>"; } }
protected void Page_Load(object sender, EventArgs e) { if (PreviousPage.IsCrossPagePostBack) { var tb = PreviousPage.FindControl("TextBox1") as TextBox; Label1.Text = tb.Text; } }
protected void Page_Load(object sender, EventArgs e) { if (Page.PreviousPage != null) { TextBox textBoxCari = (TextBox)PreviousPage.FindControl("textCari"); LabelCari.Text = "Anda sedang mencari : " + textBoxCari.Text; } }
protected void Page_Load(object sender, EventArgs e) { if (PreviousPage != null && PreviousPage.IsCrossPagePostBack) { TextBox txtUsername = (TextBox)PreviousPage.FindControl("txtUserName"); txtMsg.Text = "您輸入的名字是:" + txtUsername.Text; } }
protected void Page_Load(object sender, EventArgs e) { if (PreviousPage != null) { TextBox lblTotalPrice1 = (TextBox)PreviousPage.FindControl("txtSalesPrice"); lblTotalPrice.Text = lblTotalPrice1.Text; } }
protected void Page_Load(object sender, EventArgs e) { if (Page.PreviousPage != null) { HtmlInputText Sub = (HtmlInputText)PreviousPage.FindControl("EID"); SubjectID.Text = Sub.Value.ToString(); } }
protected void Page_Load(object sender, EventArgs e) { //string name = Request.Form["txtUserName"]; string name = ((TextBox)PreviousPage.FindControl("txtUserName")).Text; Response.Write("Hello " + name); }
protected void Page_Load(object sender, EventArgs e) { if (PreviousPage.IsCrossPagePostBack) { lblMsg.Text = "用户名:" + PreviousPage.Name + "<br/>"; TextBox txtPassword = (TextBox)PreviousPage.FindControl("txtPassword"); lblMsg.Text += ",密码:" + txtPassword.Text; } }