protected void Page_Load(object sender, System.EventArgs e) { Act.Pass(); Act.NoCache(); if (!Page.IsPostBack) { Js.Focus(this, userid); bindSecLevel(); bindAgent(); //Password awal pass.Text = Cf.Random(5); //Daftar 10 terbaru Fill(); } FeedBack(); ClientScript.RegisterOnSubmitStatement( GetType() , "submitScript" , "document.getElementById('passMD5').value=hex_md5(document.getElementById('pass').value);" ); }
private void md5() { ClientScript.RegisterOnSubmitStatement( GetType() , "submitScript" , "document.getElementById('passMD5').value=hex_md5(document.getElementById('pass').value);" ); }
protected void btnSave_Click(object sender, EventArgs e) { string email = User.Identity.Name.ToString(); string current_pw = txtCurrentPw.Text.ToString(); string new_pw1 = txtNewPw1.Text.ToString(); string new_pw2 = txtNewPw2.Text.ToString(); string password; string constr = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString; using (OleDbConnection con = new OleDbConnection(constr)) { using (OleDbCommand cmd = new OleDbCommand("SELECT user_password FROM [App Dev CW2].[dbo].[User] WHERE user_username = '******'")) { cmd.Connection = con; con.Open(); var usr = cmd.ExecuteReader(); usr.Read(); password = usr.GetString(0); con.Close(); } if (password == current_pw) { if (new_pw1 == new_pw2) { using (OleDbCommand cmd2 = new OleDbCommand("Update [App Dev CW2].[dbo].[User] SET user_password = '******' where user_username = '******'")) { cmd2.Connection = con; con.Open(); cmd2.ExecuteNonQuery(); con.Close(); } string script = "alert('Password successfully changed'); "; ScriptManager.RegisterStartupScript(this.Page, GetType(), "ClosePopup", script, true); System.Diagnostics.Debug.WriteLine("Item quantity specified not available."); } else { string script = "alert(\"Password fields did not match\"); "; ClientScript.RegisterClientScriptBlock(this.GetType(), "ConfirmSubmit", script); ClientScript.RegisterOnSubmitStatement(this.GetType(), "ConfirmSubmit", script); System.Diagnostics.Debug.WriteLine("Item quantity specified not available."); } } else { string script = "alert(\"Incorrect current password\"); "; ClientScript.RegisterClientScriptBlock(this.GetType(), "ConfirmSubmit", script); ClientScript.RegisterOnSubmitStatement(this.GetType(), "ConfirmSubmit", script); System.Diagnostics.Debug.WriteLine("Item quantity specified not available."); } } }
public void ShowMsg() { string message = "Do you want to Submit?"; System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append("return confirm('"); sb.Append(message); sb.Append("');"); ClientScript.RegisterOnSubmitStatement(this.GetType(), "alert", sb.ToString()); }
protected void btn_action(object sender, EventArgs e) { string message = "This site says..."; System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append("alert('"); sb.Append(message); sb.Append(" ');"); ClientScript.RegisterOnSubmitStatement(this.GetType(), "alert", sb.ToString()); }
protected void Submit1_Click(object sender, EventArgs e) { string message = "Do you want to Submit?"; System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append("return confirm('"); sb.Append(message); sb.Append("');"); ClientScript.RegisterOnSubmitStatement(this.GetType(), "alert", sb.ToString()); }
protected void Page_Load(object sender, EventArgs e) { if (this.Page.User.Identity.IsAuthenticated) { string message = "Login Successful! "; System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append("alert('"); sb.Append(message); sb.Append("');"); ClientScript.RegisterOnSubmitStatement(this.GetType(), "alert", sb.ToString()); Response.Redirect(FormsAuthentication.DefaultUrl); } }
/// <summary> /// Scripts para renderizar o aviso de processamento /// </summary> /// private void RenderizarAguarde() { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("<script language=\"javascript\" src=\"../scripts/web.js\"></script>"); stringBuilder.Append("<script>document.forms[0].BP_RealOnSubmit = document.forms[0].submit;"); stringBuilder.Append("function BP_OnSubmit(){"); stringBuilder.Append("try {document.forms[0].BP_RealOnSubmit();} catch(e) { }"); stringBuilder.Append("}"); stringBuilder.Append("document.forms[0].submit = BP_OnSubmit;</script>"); ClientScript.RegisterStartupScript(this.GetType(), "IncluirAguarde", stringBuilder.ToString(), false); ClientScript.RegisterOnSubmitStatement(this.GetType(), "Aguarde", "if (typeof(ValidatorOnSubmit) == 'function' && ValidatorOnSubmit() == false) return false; if(typeof(avisoAguarde) == 'function')avisoAguarde();"); }
protected void Page_Load(object sender, System.EventArgs e) { Act.Pass(); Act.NoCache(); if (!Page.IsPostBack) { nobg.Attributes["ondblclick"] = "popDaftarBG();"; InitForm(); Js.Focus(this, ket); nilaitr.Visible = false; Js.NumberFormat(nilai); Js.NumberFormat(admBank); Js.NumberFormat(lebihBayar); Js.NumberFormat(lb); Js.NumberFormat(biayaadmin); biayaadmin.Attributes["onblur"] += "javascript:hitungbiayaadmin();"; lb.Attributes["onblur"] += "javascript:hitungbiayaadmin();"; lebihBayar.Attributes["onblur"] += "javascript:hitungbiayaadmin();"; admBank.Attributes["onblur"] += "javascript:hitungbiayaadmin();"; gt.Attributes.Add("readonly", "readonly"); grandtotal.Attributes.Add("readonly", "readonly"); fillAcc(); } ClientScript.RegisterOnSubmitStatement( GetType(), "hitungulang", "hitunggt();" ); ClientScript.RegisterStartupScript( GetType(), "hitungulang2", "hitunggt();", true ); if (detildiv.Visible) { Js.Confirm(this, "Lanjutkan proses registrasi tanda terima sementara?"); } FillTb(); }
protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); //Resize the height of the pop-up on submit, if it is the case if (!ClientScript.IsOnSubmitStatementRegistered(this.Page.GetType(), "ResizePopUp")) { ClientScript.RegisterOnSubmitStatement(this.Page.GetType(), "ResizePopUp", "SetPopUpHeight();"); } //Get the bool value indicating if the page is opened from user settings page or not bool isFromUserSettings = String.IsNullOrEmpty(HttpContext.Current.Request.QueryString["UserSettings"]) ? false : true; if (!isFromUserSettings) { //Hide the cancel button if not coming from user settings btnCancel.Visible = false; } }
protected void adicionarnovo() { try { string message = "Do you want to submit?"; ClientScript.RegisterOnSubmitStatement(this.GetType(), "confirm", "return confirm('" + message + "');"); string a = Guid.NewGuid().ToString(); int contar = si.Cartas_tb.Count(); var pedidonumero = "UCM710" + "0" + contar.ToString(); Cartas_tb dp = new Models.Cartas_tb(); dp.NomeRequerente = txtNomeCliente.Text; dp.idCurso = int.Parse(txtCurso.SelectedValue); dp.Periodo = DropDownListPeriodo.Text; dp.CodigoCarta = pedidonumero; dp.DataCarta = DateTime.Now; dp.idPedido = int.Parse(txtPedido.SelectedValue); dp.idUsuario = idu; dp.idPastaDepartamento = int.Parse(txtPasta.SelectedValue); dp.Estado = "Enviado"; dp.GuidMap = a; dp.Documento1 = ReadFileBite(FileUpload1.PostedFile); dp.Documento2 = ReadFileBite(FileUpload2.PostedFile); si.Cartas_tb.Add(dp); si.SaveChanges(); //string message = "Dados Salvo com Sucesso!"; //string script = "window.onload = function(){ alert('"; //script += message; //script += "')};"; //ClientScript.RegisterStartupScript(this.GetType(), "SuccessMessage", script, true); //Response.Redirect("WebFormInicio.aspx"); ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Form submitted.');", true); // ScriptManager.RegisterStartupScript(this, this.GetType(), "err_msg", "alert('" + "abe" + "');window.location='WebFormInicio.aspx';", true); } catch (Exception) { throw; } }
protected override void OnInit(EventArgs e) { //se o div de Aguarde ainda estiver mostrando ele tira System.Web.UI.ScriptManager src = ScriptManager.GetCurrent(Page); if (src != null) { ScriptManager.RegisterClientScriptBlock(this, typeof(void), "TiraDivAguarde", "if(document.getElementById('divProcessando'))document.getElementById('divProcessando').style.display = 'none';", true); } else { ClientScript.RegisterStartupScript(typeof(Page), "TiraDivAguarde", "if(document.getElementById('divProcessando'))document.getElementById('divProcessando').style.display = 'none';", true); } ClientScript.RegisterOnSubmitStatement(this.GetType(), "zerarfiltro", "if(document.getElementById('divProcessando') && document.getElementById('divProcessando').style.display!='none')return false;"); ClientScript.RegisterOnSubmitStatement(this.GetType(), "Aguarde", "if (typeof(ValidatorOnSubmit) == 'function' && ValidatorOnSubmit() == false) return false; avisoAguarde();"); base.OnInit(e); }
protected void Page_Load(object sender, System.EventArgs e) { Act.Pass(); Act.NoCache(); SetTemplate(); if (!Page.IsPostBack) { Fill(); } if (reprint.Visible) { ClientScript.RegisterOnSubmitStatement( GetType() , "md5Script" , "document.getElementById('pass').value=hex_md5(document.getElementById('pass').value);" ); } }
protected override void OnPreRender(EventArgs e) { try { base.OnPreRender(e); if (!ClientScript.IsOnSubmitStatementRegistered(this.Page.GetType(), "ResizePopUp")) { ClientScript.RegisterOnSubmitStatement(this.Page.GetType(), "ResizePopUp", "SetPopUpHeight(); if(Page_IsValid) this.disabled=true;"); } } catch (IndException ex) { ShowError(ex); return; } catch (Exception ex) { ShowError(new IndException(ex)); return; } }
protected void Page_Load(object sender, System.EventArgs e) { Act.Pass(); Act.NoCache(); //req panahome -- lunas booking fee decimal TagihanBF = 0; // Db.SingleDecimal("select ISNULL(SUM(NilaiTagihan), 0) from MS_TAGIHAN where NoKontrak = '" + NoKontrak + "' and Tipe = 'BF'"); decimal PelunasanBF = 0; // Db.SingleDecimal("select ISNULL(SUM(NilaiPelunasan),0) from MS_PELUNASAN where NoKontrak = '" + NoKontrak + "' and SudahCair != 0 and NoTagihan IN (select NoUrut from MS_TAGIHAN where Tipe = 'BF')"); if (PelunasanBF != TagihanBF) { nokontrakbf.Text = NoKontrak.ToString(); reprint.Visible = false; alertbf.Visible = true; } else { reprint.Visible = false; alertbf.Visible = false; //string Lokasi = Db.SingleString("SELECT Lokasi FROM MS_KONTRAK WHERE NoKontrak='" + NoKontrak + "'"); //if (Lokasi != "S") SetTemplate(); if (!Page.IsPostBack) { Fill(); } if (reprint.Visible) { ClientScript.RegisterOnSubmitStatement( GetType() , "md5Script" , "document.getElementById('pass').value=hex_md5(document.getElementById('pass').value);" ); } } }
protected override void OnPreRender(EventArgs e) { try { base.OnPreRender(e); //Set the ValueToCompare property of the compare validators in the page depending on the current values of costs SetCompareValidatorsValues(); if (!ClientScript.IsOnSubmitStatementRegistered(this.GetType(), "ResizePopUp")) { ClientScript.RegisterOnSubmitStatement(this.GetType(), "ResizePopUp", "SetPopUpHeight(); if(Page_IsValid) this.disabled=true;"); } } catch (IndException exc) { ShowError(exc); return; } catch (Exception exc) { ShowError(new IndException(exc)); return; } }
protected void BMRCal_Click(object sender, EventArgs e) { Regex regex = new Regex("^[0-9]*$"); double BMR = 0; if (txtAge.Text.Length == 0 || txtHeightcm.Text.Length == 0 || txtWeight.Text.Length == 0) { // Response.Write("<script LANGUAGE='JavaScript' >alert('Please enter information')</script>"); ClientScript.RegisterOnSubmitStatement(this.GetType(), "alert", "alert('Please enter information')"); } else if (regex.IsMatch(txtAge.Text) == false || regex.IsMatch(txtHeightcm.Text) == false || regex.IsMatch(txtWeight.Text) == false) { // Response.Write("<script LANGUAGE='JavaScript' >alert('Please input the valid information')</script>"); ClientScript.RegisterOnSubmitStatement(this.GetType(), "alert", "alert('Please input the valid information')"); } if (DropListGender.SelectedValue == "Female") { if (DropDownList1.SelectedValue == "cm" && DropDownList2.SelectedValue == "kg") { BMR = (655 + (4.35 * Convert.ToDouble(txtWeight.Text) * 2.20462) + (4.7 * Convert.ToDouble(txtHeightcm.Text) / 2.54) - (4.7 * Convert.ToDouble(txtAge.Text))); } else if (DropDownList1.SelectedValue == "inch" && DropDownList2.SelectedValue == "lb") { BMR = (655 + (4.35 * Convert.ToDouble(txtWeight.Text)) + (4.7 * Convert.ToDouble(txtHeightcm.Text)) - (4.7 * Convert.ToDouble(txtAge.Text))); } else if (DropDownList1.SelectedValue == "cm" && DropDownList2.SelectedValue == "lb") { BMR = (655 + (4.35 * Convert.ToDouble(txtWeight.Text)) + (4.7 * Convert.ToDouble(txtHeightcm.Text) / 2.54) - (4.7 * Convert.ToDouble(txtAge.Text))); } else { BMR = (655 + (4.35 * Convert.ToDouble(txtWeight.Text) * 2.20462) + (4.7 * Convert.ToDouble(txtHeightcm.Text)) - (4.7 * Convert.ToDouble(txtAge.Text))); } } if (DropListGender.SelectedValue == "Male") { if (DropDownList1.SelectedValue == "cm" && DropDownList2.SelectedValue == "kg") { BMR = (66 + (6.23 * Convert.ToDouble(txtWeight.Text) * 2.20462) + (12.7 * Convert.ToDouble(txtHeightcm.Text) / 2.54) - (6.8 * Convert.ToDouble(txtAge.Text))); } else if (DropDownList1.SelectedValue == "inch" && DropDownList2.SelectedValue == "lb") { BMR = (66 + (6.23 * Convert.ToDouble(txtWeight.Text)) + (12.7 * Convert.ToDouble(txtHeightcm.Text)) - (6.8 * Convert.ToDouble(txtAge.Text))); } else if (DropDownList1.SelectedValue == "cm" && DropDownList2.SelectedValue == "lb") { BMR = (66 + (6.23 * Convert.ToDouble(txtWeight.Text)) + (12.7 * Convert.ToDouble(txtHeightcm.Text) / 2.54) - (6.8 * Convert.ToDouble(txtAge.Text))); } else { BMR = (66 + (6.23 * Convert.ToDouble(txtWeight.Text) * 2.20462) + (12.7 * Convert.ToDouble(txtHeightcm.Text)) - (6.8 * Convert.ToDouble(txtAge.Text))); } } if (DropDownList3.SelectedValue == "No exercise") { BMR = BMR * 1.2; } else if (DropDownList3.SelectedValue == "Light exercise (1-3 days per week)") { BMR = BMR * 1.375; } else if (DropDownList3.SelectedValue == "Moderate exercise (3–5 days per week)") { BMR = BMR * 1.55; } else if (DropDownList3.SelectedValue == "Heavy exercise (6–7 days per week)") { BMR = BMR * 1.725; } else if (DropDownList3.SelectedValue == "Very heavy exercise (twice per day, extra heavy workouts)") { BMR = BMR * 1.9; } BMR = Math.Round(BMR, 2); txtResult.Text = BMR.ToString(); //BMI = ( Weight in Kilograms / ( Height in Meters x Height in Meters ) ) txtBMI.Text = getBMI().ToString(); }
/// <summary> /// Takes the input details of the admin registering and /// stores it in the admin database. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Btnsubmit_Click(object sender, EventArgs e) { // for inserting using simple sql query if (count == 0) { if (!String.IsNullOrEmpty(Txtname.Text.Trim()) && !String.IsNullOrEmpty(Txtmail.Text.Trim()) && !String.IsNullOrEmpty(Txtid.Text.Trim())) { // Connecting to the database string strcon = ConfigurationManager.ConnectionStrings["mycon"].ConnectionString; SqlConnection con = new SqlConnection(strcon); con.Open(); // providing SQL Query to insert the values into the database try { SqlCommand cmd2 = new SqlCommand("insert into ADMIN " + "(ADMIN_ID, ADMIN_NAME, ADMIN_PASS, DESIGNATION, EMAIL_ID) " + "values ('" + Txtid.Text + "', '" + Txtname.Text + "', '" + Txtpass.Text + "', '" + Txtdesig.Text + "', '" + Txtmail.Text + "')", con); cmd2.ExecuteNonQuery(); } catch (Exception ex) { count1 = 1; this.Page.ClientScript.RegisterStartupScript(this.GetType(), "ex", "alert('" + ex.Message + "');", true); } // Creating session attributes to display the details to profile if (count1 == 0) { Session.Add("Response5", Txtname.Text); Session.Add("Response7", Txtmail.Text); Session.Add("Response8", Txtid.Text); Session.Add("Response9", Txtdesig.Text); Response.Redirect("AdminPro.aspx"); } else { string message = "Existing profile!!!!!"; System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append("<script type = 'text/javascript'>"); sb.Append("window.onload=function(){"); sb.Append("alert('"); sb.Append(message); sb.Append("')};"); sb.Append("</script>"); ClientScript.RegisterOnSubmitStatement(this.GetType(), "alert", sb.ToString()); } } } else { string message = "Please fill credentials!!!!!"; System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append("<script type = 'text/javascript'>"); sb.Append("window.onload=function(){"); sb.Append("alert('"); sb.Append(message); sb.Append("')};"); sb.Append("</script>"); ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", sb.ToString()); Response.Redirect("AdminReg.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { string message = "Do you want to submit?"; ClientScript.RegisterOnSubmitStatement(this.GetType(), "confirm", "return confirm('" + message + "');"); string v = Request.QueryString["id"]; SqlConnection con = new SqlConnection("Data Source=orthodbserver.database.windows.net;Initial Catalog=ImageOrthoDB;Integrated Security=False;User ID=serveradmin;password=User$179317$;"); // int pid = (int)(v.ToString());//(Session["IDValue"]); con.Open(); SqlCommand cmd = new SqlCommand("Select * from [dbo].[tbl_OrderStageDate] WHERE [Orderid]= '" + v + "'", con); SqlDataReader readStage = cmd.ExecuteReader(); while (readStage.Read()) { Label25.Text = readStage["NewOrder"].ToString(); TextBox1.Text = readStage["NewOrder_tek"].ToString(); Label26.Text = readStage["ReadytoProcess"].ToString(); if (readStage["ReadytoProcess_tek"] != DBNull.Value || readStage["ReadytoProcess_tek"].ToString() != "") { TextBox2.Text = readStage["ReadytoProcess_tek"].ToString(); } Label37.Text = readStage["DesignStart"].ToString(); if (readStage["DesignStart_tek"] != DBNull.Value || readStage["DesignStart_tek"].ToString() != "") { TextBox13.Text = readStage["DesignStart_tek"].ToString(); } Label38.Text = readStage["CAM"].ToString(); if (readStage["CAM_tek"] != DBNull.Value || readStage["CAM_tek"].ToString() != "") { TextBox14.Text = readStage["CAM_tek"].ToString(); } Label27.Text = readStage["Milled"].ToString(); if (readStage["Milled_tek"].ToString() != "" || readStage["Milled_tek"] != DBNull.Value) { TextBox3.Text = readStage["Milled_tek"].ToString(); } Label28.Text = readStage["Molding"].ToString(); if (readStage["Molding_tek"].ToString() != "" || readStage["Molding_tek"] != DBNull.Value) { TextBox4.Text = readStage["Modling_tek"].ToString(); } Label34.Text = readStage["Grinding"].ToString(); if (readStage["Grinding_tek"].ToString() != "" || readStage["Grinding_tek"] != DBNull.Value) { TextBox10.Text = readStage["Grinding_tek"].ToString(); } Label35.Text = readStage["Posting"].ToString(); if (readStage["Posting_tek"].ToString() != "" || readStage["Posting_tek"] != DBNull.Value) { TextBox11.Text = readStage["Posting_tek"].ToString(); } Label36.Text = readStage["Accomodations"].ToString(); if (readStage["Accomodations_tek"].ToString() != "" || readStage["Accomodations_tek"] != DBNull.Value) { TextBox12.Text = readStage["Accomodations_tek"].ToString(); } Label39.Text = readStage["TopCovering"].ToString(); if (readStage["TopCovering_tek"].ToString() != "" || readStage["TopCovering_tek"] != DBNull.Value) { TextBox15.Text = readStage["TopCovering_tek"].ToString(); } Label40.Text = readStage["Finishing"].ToString(); if (readStage["Finishing_tek"].ToString() != "" || readStage["Finishing_tek"] != DBNull.Value) { TextBox16.Text = readStage["Finishing_tek"].ToString(); } Label32.Text = readStage["ManufacturerQuality"].ToString(); if (readStage["ManufacturerQuality_tek"].ToString() != "" || readStage["ManufacturerQuality_tek"] != DBNull.Value) { TextBox8.Text = readStage["ManufacturerQuality_tek"].ToString(); } Label33.Text = readStage["Shipped"].ToString(); if (readStage["ShipBy_CA"].ToString() != "" || readStage["ShipBy_CA"] != DBNull.Value) { TextBox9.Text = readStage["ShipBy_CA"].ToString(); } if (readStage["ShipBy_MX"].ToString() != "" || readStage["ShipBy_MX"] != DBNull.Value) { TextBox17.Text = readStage["ShipBy_MX"].ToString(); } Label41.Text = readStage["AdditionalQuality"].ToString(); if (readStage["AdditionalQuality_tek"].ToString() != "" || readStage["AdditionalQuality_tek"] != DBNull.Value) { TextBox18.Text = readStage["AdditionalQuality_tek"].ToString(); } } readStage.Close(); con.Close(); }
protected void Page_Load(object sender, EventArgs e) { string url = null; url = Request.QueryString["formurl"]; //取到链接地址中的值 if (url != "MyLogin") { //根据链接地址中的url值判断是否继续进入登录界面 //返回到第一页 Response.Redirect("default.aspx"); } Button Button1 = new Button(); //开始判断客户端显示分辨率 if (!IsPostBack) { HtmlInputHidden btnW = new HtmlInputHidden(); HtmlInputHidden btnH = new HtmlInputHidden(); Button1.ID = "Button1"; Button1.CssClass = "btnhide"; //利用css样式将该按钮隐藏显示 btnW.Name = "WidthPixel"; btnW.ID = "WidthPixel"; btnH.Name = "HeightPixel"; btnH.ID = "HeightPixel"; FindControl("browserpeek").Controls.Add(btnW); FindControl("browserpeek").Controls.Add(btnH); FindControl("browserpeek").Controls.Add(Button1); string scriptString = ""; scriptString += "document.browserpeek.WidthPixel.value=window.screen.width;"; scriptString += "document.browserpeek.HeightPixel.value=window.screen.height;"; ClientScript.RegisterOnSubmitStatement(this.GetType(), "Meng", scriptString); MyBody.Attributes.Add("onload", "document.browserpeek.Button1.click();"); } else { MyBody.Attributes.Remove("onload"); if (this.FindControl("browserpeek").Controls.Contains(Button1)) { this.FindControl("browserpeek").Controls.Remove(Button1); Button1.Dispose(); } StringBuilder strLabel = new StringBuilder(); HttpBrowserCapabilities bc = Request.Browser; //首先集中指定一级cookies的过期时间 Response.Cookies["huayi"].Expires = new DateTime(2020, 1, 1); Response.Cookies["hygk"].Expires = new DateTime(2020, 1, 1); if (Request.Cookies["mretail_defiw"] == null) { //判断cookies是否不存在 if (Request.Form["WidthPixel"] == "1024" & Request.Form["HeightPixel"] == "768") { Response.Cookies["mretail_defiw"].Value = "815"; Response.Cookies["mretail_defih"].Value = "510"; Response.Cookies["mretail_defiw"].Expires = new DateTime(2015, 1, 1); Response.Cookies["mretail_defih"].Expires = new DateTime(2015, 1, 1); } else { if (Request.Form["WidthPixel"] == "800" & Request.Form["HeightPixel"] == "600") { Response.Cookies["mretail_defiw"].Value = "768"; Response.Cookies["mretail_defih"].Value = "338"; Response.Cookies["mretail_defiw"].Expires = new DateTime(2020, 1, 1); Response.Cookies["mretail_defih"].Expires = new DateTime(2020, 1, 1); } else { if (Request.Form["WidthPixel"] == "1280" & Request.Form["HeightPixel"] == "800") { Response.Cookies["mretail_defiw"].Value = "1070"; Response.Cookies["mretail_defih"].Value = "540"; Response.Cookies["mretail_defiw"].Expires = new DateTime(2020, 1, 1); Response.Cookies["mretail_defih"].Expires = new DateTime(2020, 1, 1); } else { if (Request.Form["WidthPixel"] == "1280" & Request.Form["HeightPixel"] == "768") { Response.Cookies["mretail_defiw"].Value = "1070"; Response.Cookies["mretail_defih"].Value = "530"; Response.Cookies["mretail_defiw"].Expires = new DateTime(2020, 1, 1); Response.Cookies["mretail_defih"].Expires = new DateTime(2020, 1, 1); } else { if (Request.Form["WidthPixel"] == "1280" & Request.Form["HeightPixel"] == "1024") { Response.Cookies["mretail_defiw"].Value = "1070"; Response.Cookies["mretail_defih"].Value = "780"; Response.Cookies["mretail_defiw"].Expires = new DateTime(2020, 1, 1); Response.Cookies["mretail_defih"].Expires = new DateTime(2020, 1, 1); } else { if (Request.Form["WidthPixel"] == "1360" & Request.Form["HeightPixel"] == "769") { Response.Cookies["mretail_defiw"].Value = "1070"; Response.Cookies["mretail_defih"].Value = "780"; Response.Cookies["mretail_defiw"].Expires = new DateTime(2020, 1, 1); Response.Cookies["mretail_defih"].Expires = new DateTime(2020, 1, 1); } else { if (Request.Form["WidthPixel"] == "1366" & Request.Form["HeightPixel"] == "768") { Response.Cookies["mretail_defiw"].Value = "1070"; Response.Cookies["mretail_defih"].Value = "780"; Response.Cookies["mretail_defiw"].Expires = new DateTime(2020, 1, 1); Response.Cookies["mretail_defih"].Expires = new DateTime(2020, 1, 1); } else { Response.Cookies["mretail_defiw"].Value = "1150"; Response.Cookies["mretail_defih"].Value = "530"; Response.Cookies["mretail_defiw"].Expires = new DateTime(2020, 1, 1); Response.Cookies["mretail_defih"].Expires = new DateTime(2020, 1, 1); } } } } } } } } } }
public new void RegisterOnSubmitStatement( string key, string script) { ClientScript.RegisterOnSubmitStatement(typeof(Page), key, script); }