protected void Page_Load(object sender, EventArgs e) { Users usr = (Users)Session["Identify"]; BasicInfo info = BasicInfo.GetBasicInfoByID(usr.UserID); if (!PageAuthorityManage.hasAuthority(info, "固定资产申购")) { Response.Write("<script Language='JavaScript'>alert('抱歉!您没有此操作的权限');window.location.href ='../Account/ApplyListPage.aspx'</script>"); } ScriptManager1.RegisterAsyncPostBackControl(addRow); if (ViewState["count"] != null) { for (int i = 0; i < Convert.ToInt16(ViewState["count"]); i++) { addNewRow(); } } if (!IsPostBack) { DataSet allPro = ProjectInfo.GetAllProjects(); projectCodeList.DataSource = allPro.Tables[0].DefaultView; projectCodeList.DataTextField = "ProjectName"; projectCodeList.DataValueField = "ProjectCode"; projectCodeList.DataBind(); staffName.Text = info.StaffName; department.Text = info.Department; applyDate.Text = DateTime.Today.ToShortDateString(); } }
protected void InitControls() { this.bTitle.Text = ""; this.bOrder.Text = StringPlus.NullToString(dal.GetRecordCount("") + 1); this.bContent.Text = ""; ScriptManager1.SetFocus(this.bTitle); }
protected void Page_Load(object sender, EventArgs e) { bAdd.Attributes.Add("onclick", " this.disabled = true; " + ClientScript.GetPostBackEventReference(bAdd, null) + ";"); //tbCar.Attributes["onclick"] = "chbManual.Checeked = !chbManual.Checeked"; string tmp = ClientScript.GetPostBackEventReference(bAdd, null); ScriptManager1.RegisterAsyncPostBackControl(bAdd); DA = new SqlDataAdapter(); DS = new DataSet(); DA.SelectCommand = new SqlCommand(); DA.SelectCommand.Connection = new SqlConnection("Data Source=127.0.0.1;Initial Catalog=CWM;Persist Security Info=True;User ID=CWM;Password=manager"); if (!Page.IsPostBack) { JOB job = (JOB)Session["JOB"]; DA.SelectCommand.CommandText = "select ID,PNAME from CWM..PRICELIST where IDCLASS = " + job.IDCLASS + " order by PNAME"; DS = new DataSet(); DA.Fill(DS, "PRICE"); chblPrice.DataSource = DS.Tables["PRICE"]; chblPrice.DataTextField = "PNAME"; chblPrice.DataValueField = "ID"; chblPrice.DataBind(); chblPrice.RepeatColumns = 2; } }
public void choose(Button o) { ScriptManager1.RegisterAsyncPostBackControl(this.Button1); ScriptManager1.RegisterAsyncPostBackControl(this.Button2); timetablelinqDataContext db = new timetablelinqDataContext(); var results = from r in db.ordertable where r.month.ToString() + "月" + r.day.ToString() + "日" == o.Text.ToString() select r; for (int i = 1; i <= 91; i++) { hoverbutton k = (hoverbutton)this.FindControl("b" + i.ToString()); k.enabled = true; } if (results.FirstOrDefault() != null) { foreach (var r in results) { int a = r.addressid; int d = int.Parse(r.hour.ToString().Substring(0, 2)); hoverbutton c = (hoverbutton)this.FindControl("b" + ((a - 1) * 13 + d - 7).ToString()); c.enabled = false; } } Session["date"] = o.Text.ToString(); }
protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) { StallID = Convert.ToInt16(ViewState["StallID"].ToString()); } else { // Only bind if this is not a postback BindList(); } int totalRows = ProductList.Rows.Count; rowChanged = new bool[totalRows]; rowDeleted = new bool[totalRows]; ViewState.Add("StallID", StallID); foreach (GridViewRow row in ProductList.Rows) { var checkBox = row.FindControl("cbDelete"); ScriptManager1.RegisterAsyncPostBackControl(checkBox); } }
protected void Page_Load(object sender, EventArgs e) { //页面载入之前,先进行登录检查以及权限检查 ScriptManager1.RegisterAsyncPostBackControl(this.DropDownList_Grade); // ScriptManager1.RegisterAsyncPostBackControl(this.lessLessonTime); if (!IsPostBack) // 如果是为响应客户端回发而加载该页,则为 true;否则为 false。 { if (!(LoginAndPermissionChecking.LoginChecking())) { Response.Redirect("/ErrorPage/error_NotLogin.aspx"); } if (!(LoginAndPermissionChecking.PermissionChecking(PermissionEnum.EducationDean))) { Response.Redirect("/ErrorPage/error_DeniedPermission.aspx"); } ListItem i1 = new ListItem(HttpUtility.HtmlDecode(" ") + "初一", "1"); ListItem i2 = new ListItem(HttpUtility.HtmlDecode(" ") + "初二", "2"); ListItem i3 = new ListItem(HttpUtility.HtmlDecode(" ") + "初三", "3"); DropDownList_Grade.Items.Add(i1);//这里这么做完全是为了显示的时候可以居中,没别的意思 DropDownList_Grade.Items.Add(i2); DropDownList_Grade.Items.Add(i3); SetItemForChoosableCourse(); } Page.MaintainScrollPositionOnPostBack = true; //刷新后滚动条回到之前的位置,但是会导致页面闪烁 // Page.MaintainScrollPositionOnPostBack = false;//刷新后滚动条回到顶部 SelectCourseByGrade(); //一开始显示默认的年级的科目 }
protected void Page_Load(object sender, EventArgs e) { ScriptManager1.RegisterPostBackControl(Button1); if (!IsPostBack) { var mode = Request.Params["Mode"]; switch (mode) { case "View": DetailsView2.ChangeMode(DetailsViewMode.ReadOnly); break; case "Entry": DetailsView2.ChangeMode(DetailsViewMode.Edit); break; default: DetailsView2.ChangeMode(DetailsViewMode.Insert); DetailsView2.FooterRow.Visible = false; break; } DetailsView2Databinding(); } lblEmailSuccess.Visible = lblSaveError.Visible = false; }
protected void Page_Load(object sender, EventArgs e) { ScriptManager1.RegisterAsyncPostBackControl(lkbBuscar); // Da um postback async ao clicar no botao pesquisar para nao atualizar a pagina inteira if (!IsPostBack) //Se nao for postback, ou seja, se estiver carregando a pagina pela primeira vez { CarregaGrid(); //chama o método carregaGrid(); DataSet dsSem = Semestre_Ano_DB.SelectSemestreAno(); //preenche o dataset com o retorno do método pegando todos semestre ano DataSet dsPIsFatec = Curso.SelecionarTodos(); //preenche o dataset com o retorno do método pegando todos os cursos que vem do banco da FATEC //preenche a dropdown curso com o dataset criado anteriormente dsPIsFatec ddlCurso.DataSource = dsPIsFatec.Tables[0]; ddlCurso.DataTextField = "Sigla"; ddlCurso.DataValueField = "Codigo"; ddlCurso.DataBind(); ddlCurso.Items.Insert(0, new ListItem("Selecione", "0")); //preenche a dropdown semestre/ano com o dataset criado anteriormente dsSem ddlSemestreAno.DataSource = dsSem; ddlSemestreAno.DataTextField = "concat(SAN_ANO,'-',SAN_SEMESTRE)"; ddlSemestreAno.DataValueField = "SAN_CODIGO"; ddlSemestreAno.DataBind(); ddlSemestreAno.Items.Insert(0, new ListItem("Selecione", "0")); //preenche a dropdown status manualmente por serem valores fixos ddlStatus.Items.Insert(0, new ListItem("Selecione", "0")); ddlStatus.Items.Insert(1, new ListItem("Finalizado", "1")); ddlStatus.Items.Insert(2, new ListItem("Em andamento", "2")); } }
protected void Page_Load(object sender, EventArgs e) { ProcessLogFileName = @"Excel\" + Session["UserName"].ToString() + "ProcessLog.txt"; if (!Page.IsPostBack) { //RunByLabel.Text = Session["UserName"].ToString(); CatBegTextBox.Focus(); btnAccept.Visible = false; ProcessPanel.Visible = false; ActionPanel.Visible = false; ActionSubmitButt.Visible = false; PrintButt.Visible = false; SKUPanel.Visible = false; FactorPrompt.Visible = false; CPRFactor.Text = "1"; Session["PageOp"] = ""; string FullFilePath = Server.MapPath(ProcessLogFileName); using (StreamWriter sw = new StreamWriter(FullFilePath)) { sw.WriteLine("Branch Stocking Analysis started at " + DateTime.Now.ToLongDateString() + " " + DateTime.Now.ToLongTimeString()); } LoadBranches(); } else { SKUPanel.Height = int.Parse(yh.Text.ToString()) - 90; ActionPanel.Height = int.Parse(yh.Text.ToString()) - 90; ResultsUpdatePanel.Update(); } ScriptManager1.AsyncPostBackTimeout = 1200; //ScriptManager1.SetFocus(CatBegTextBox); ScriptManager1.RegisterAsyncPostBackControl(BranchListButt); //lblErrorMessage.Text = Session["PageOp"]; }
//protected static DataTable Patrol_DataTable = new DataTable(); protected void Page_Load(object sender, EventArgs e) { if (Session["User"] == null) { Response.Redirect("Login.aspx"); return; } var user = (User)Session["User"]; //MaintenancePanel_Patrols.Visible = true; Patrols_Add_Popup.Width = 400; Patrols_Add_Popup.Height = 400; Patrols_Add_Popup.ShowCloseButton = true; Session["UserID"] = user.UserID; Session["UserRoleID"] = Core.Handler_User.User_Role_Maintenance; if (!Page.IsPostBack) { if (Patrol_Add_Ahwal_ComboBox.Items.Count > 0) { Patrol_Add_Ahwal_ComboBox.SelectedIndex = 0; } PatrolsGrid.DataBind(); } ScriptManager1.RegisterPostBackControl(PatrolsGrid); }
protected void PreRenderBtnTrigger(object sender, EventArgs e) { Button btn = (Button)sender; ScriptManager1.RegisterAsyncPostBackControl(btn); AchievementsUpdatePanel.Update(); }
/// <summary> /// Order fins based on customer and PO/Invoice /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void ibtnHeaderFind_Click(object sender, ImageClickEventArgs e) { if (txtCustomerNumber.Text != "") { string ddlbind = ddlconditionBind(); if (ddlHeaderType.SelectedValue == "PO" && ViewState["CustomerNumber"] != null && txtCustomerNumber.Text.Trim() != "" && txtSOInvoiceNo.Text.Trim() != "") { whereClause = "SellToCustNo='" + ViewState["CustomerNumber"].ToString() + "' and CustPONo='" + txtSOInvoiceNo.Text + "'" + deleteCondition; } else if (ddlHeaderType.SelectedValue == "IN" && txtCustomerNumber.Text.Trim() != "" && txtSOInvoiceNo.Text.Trim() != "") { whereClause = "SellToCustNo='" + ViewState["CustomerNumber"].ToString() + "' and Invoiceno='" + txtSOInvoiceNo.Text + "'" + deleteCondition; } else { whereClause = "SellToCustNo='" + ViewState["CustomerNumber"].ToString() + "'"; } whereClause = whereClause + ddlbind; BindDataGrid(); } else { ScriptManager.RegisterClientScriptBlock(ibtnHeaderFind, ibtnHeaderFind.GetType(), "required", "alert('Enter Customer Number');", true); ScriptManager1.SetFocus(txtCustomerNumber); } }
protected void Page_Load(object sender, EventArgs e) { Users usr = (Users)Session["Identify"]; BasicInfo info = BasicInfo.GetBasicInfoByID(usr.UserID); if (!PageAuthorityManage.hasAuthority(info, "出差报销")) { Response.Write("<script Language='JavaScript'>alert('抱歉!您没有此操作的权限');window.location.href ='../Account/ApplyListPage.aspx'</script>"); } ScriptManager1.RegisterAsyncPostBackControl(projectNameList); if (!IsPostBack) {//首次加载才需要绑定 DataSet allPro = ProjectInfo.GetAllProjects(); projectNameList.DataSource = allPro.Tables[0].DefaultView; projectNameList.DataTextField = "ProjectName"; projectNameList.DataValueField = "ProjectName"; projectNameList.DataBind(); accountList.DataSource = allPro.Tables[0].DefaultView; accountList.DataTextField = "ProjectAccount"; accountList.DataValueField = "ProjectAccount"; accountList.DataBind(); accountList.SelectedValue = ProjectInfo.GetProjectInfoByName(projectNameList.SelectedValue).ProjectAccount; staffName.Text = info.StaffName; department.Text = info.Department; applyDate.Text = DateTime.Today.ToShortDateString(); } // }
protected void Page_Load(object sender, EventArgs e) { ScriptManager1.RegisterAsyncPostBackControl(lkbPesquisar); ScriptManager1.RegisterPostBackControl(ddlAcao); ScriptManager1.RegisterPostBackControl(ddlTabela); if (!IsPostBack) { CarregarGridAuditoria(); //updFiltro.Update(); UpdatePanelAuditoria.Update(); //UpdatePanelAuditoria.Update(); ddlAcao.Items.Insert(0, new ListItem("Selecione", "SELECIONE")); ddlAcao.Items.Insert(1, new ListItem("Inserção", "INSERCAO")); ddlAcao.Items.Insert(2, new ListItem("Alteração", "ALTERACAO")); ddlAcao.Items.Insert(3, new ListItem("Exclusão", "EXCLUSAO")); ddlTabela.Items.Insert(0, new ListItem("Selecione", "SELECIONE")); ddlTabela.Items.Insert(1, new ListItem("Critérios Gerais", "CGE_CRITERIOS_GERAIS")); ddlTabela.Items.Insert(2, new ListItem("Criterios do PI", "CPI_CRITERIO_PI")); ddlTabela.Items.Insert(3, new ListItem("Eventos", "EVE_EVENTOS")); ddlTabela.Items.Insert(4, new ListItem("Alunos do grupo", "GAL_GRUPO_ALUNO")); ddlTabela.Items.Insert(5, new ListItem("Grupo", "GRU_GRUPO")); ddlTabela.Items.Insert(6, new ListItem("Histórico do Aluno", "HIS_HISTORICO_ALUNO_DISCIPLINA")); ddlTabela.Items.Insert(7, new ListItem("Mensagens", "MSG_MENSAGEM")); ddlTabela.Items.Insert(8, new ListItem("Coordenadores", "PER_PERFIL")); ddlTabela.Items.Insert(9, new ListItem("Requerimento", "REQ_REQUERIMENTO")); } ddlAcao.AutoPostBack = false; ddlTabela.AutoPostBack = false; }
protected void dlBlogComments_ItemDataBound(object sender, DataListItemEventArgs e) { //LinkButton delete_button = (LinkButton)dlBlogComments.FindControl("lnkbtnDelete"); try { if (Convert.ToInt32(DataBinder.Eval(e.Item.DataItem, "poster_id")) == Convert.ToInt32(Session["user_id"]) && Convert.ToInt32(DataBinder.Eval(e.Item.DataItem, "is_admin")) == 0) { System.Web.UI.HtmlControls.HtmlGenericControl divoptions = (System.Web.UI.HtmlControls.HtmlGenericControl)e.Item.FindControl("div_blog_comment_options"); LinkButton DeleteButton = new LinkButton(); DeleteButton.ID = "lnkbtnDelete"; DeleteButton.Command += new CommandEventHandler(lnkbtnDelete_Command); DeleteButton.CommandArgument = DataBinder.Eval(e.Item.DataItem, "comment_id").ToString(); DeleteButton.CssClass = "lnkbtnDelete"; DeleteButton.Text = "Delete"; divoptions.Controls.Add(DeleteButton); ScriptManager1.RegisterAsyncPostBackControl(DeleteButton); //add the profile pic of the commenter } Image imgpp = (Image)e.Item.FindControl("img_commenter_pic"); imgpp.ImageUrl = GetImageUrl(Convert.ToInt32(DataBinder.Eval(e.Item.DataItem, "poster_id")), Convert.ToInt16(DataBinder.Eval(e.Item.DataItem, "is_admin"))); } catch (Exception ex) { ErrorReportBAL error = new ErrorReportBAL(); error.SendErrorReport("ViewPost.aspx", ex.ToString()); Response.Write("<script>alert('Some Error Occured \n Sorry for inconvenience');</script>"); } }
protected void Page_Load(object sender, EventArgs e) { ScriptManager1.RegisterAsyncPostBackControl(Button1); id3 = Convert.ToInt32(Request.Params["type"]); id1 = Convert.ToInt32(Request.Params["id"]); fengye(); }
protected void Page_Load(object sender, EventArgs e) { try { ScriptManager1.RegisterAsyncPostBackControl(Btn_Send); //ScriptManager1.RegisterAsyncPostBackControl(Timer1); litMessages.SelectedIndex = litMessages.Items.Count - 1; if (!IsPostBack && Session["LoggedIn"] != null && Session["LoggedIn"].ToString() != "true") { dtCheck = DateTime.Now.ToString(); string roomID = Request["roomID"]; lblRoomID.Text = roomID; this.InsertMessage(ConfigurationManager.AppSettings["ChatLoggedInText"] + "" + DateTime.Now.ToString()); litMessages.SelectedIndex = litMessages.Items.Count - 1; this.GetLoggenInUser(); } else { dtCheck = DateTime.Now.ToString(); string roomID = Request["roomID"]; lblRoomID.Text = roomID; litMessages.SelectedIndex = litMessages.Items.Count - 1; } } catch (Exception ex) { Console.WriteLine(ex); } }
protected void Page_Load(object sender, EventArgs e) { //Register Update Trigger ScriptManager1.RegisterAsyncPostBackControl(ButtonInv1); SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["MeetMeConnectionString"].ConnectionString); SqlDataAdapter sdaUserData = new SqlDataAdapter("select * from Users where email='" + Session["New"].ToString() + "'", conn); DataTable dt = new DataTable(); sdaUserData.Fill(dt); UID = dt.Rows[0]["UserID"].ToString(); //Notification System SqlDataAdapter sdaMesaje = new SqlDataAdapter("select * from Mesaje where userId='" + UID + "'", conn); DataTable dtt = new DataTable(); sdaMesaje.Fill(dtt); foreach (DataRow msgRes in dtt.Rows) { if (msgRes["seen"].ToString().Trim() == "no") { chatTab.Attributes.Add("style", "background-color:#b50000; border-radius: 5px;"); break; } } SqlDataAdapter sdaFriendReq = new SqlDataAdapter("select * from FriendRequests where userId='" + UID + "'", conn); DataTable dt1 = new DataTable(); sdaFriendReq.Fill(dt1); foreach (DataRow friendReqRes in dt1.Rows) { if (friendReqRes["seen"].ToString().Trim() == "no") { testDepTxt.Attributes.Add("style", "background-color:#b50000; border-radius: 5px;"); break; } } SqlDataAdapter sdaDateReq = new SqlDataAdapter("select * from DateRequests where fId='" + UID + "'", conn); DataTable dt2 = new DataTable(); sdaDateReq.Fill(dt2); foreach (DataRow dateReqRes in dt2.Rows) { if (dateReqRes["seen"].ToString().Trim() == "no") { dateReqTab.Attributes.Add("style", "background-color:#b50000; border-radius: 5px;"); break; } } }
protected void GridView1_PreRender(object sender, EventArgs e) { //ScriptManager1.RegisterPostBackControl(Lbtn_newsContent); for (int i = 0; i < GridView1.Rows.Count; i++) { ScriptManager1.RegisterPostBackControl(GridView1.Rows[i].FindControl("LinkButton1")); } }
protected void Btn_Send_Click(object sender, EventArgs e) { InsertMessage(null); GetMessage(); litMessages.SelectedIndex = litMessages.Items.Count - 1; ScriptManager1.SetFocus(txtMessage.ClientID); }
protected void Page_Load(object sender, EventArgs e) { ScriptManager1.RegisterAsyncPostBackControl(Slider1); if (Page.IsPostBack) { lblUpdateDate.Text = "Changed at: " + DateTime.Now.ToLongTimeString(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindNavigation(); } ScriptManager1.RegisterPostBackControl(btnImgUpdate); ScriptManager1.RegisterPostBackControl(btnTechSpcUpdate); }
protected void Wizard1_ActiveStepChanged(object sender, EventArgs e) { if ((ScriptManager1.IsInAsyncPostBack) && (!ScriptManager1.IsNavigating)) { string currentStep = Wizard1.ActiveStepIndex.ToString(); ScriptManager1.AddHistoryPoint("Wizard1", Wizard1.ActiveStepIndex.ToString(), "Step " + (Wizard1.ActiveStepIndex + 1).ToString()); } }
protected void BtnSend_Click(object sender, EventArgs e) { if (txtMessage.Text.Length > 0) { this.InsertMessage(null); this.GetMessages(); txtMessage.Text = String.Empty; ScriptManager1.SetFocus(txtMessage.ClientID); } }
protected void Timer1_OnTick(object sender, EventArgs e) { this.GetLoggedInUsers(); this.GetMessages(); if ((string)Session["IsChatroomInFocus"] == null) { ScriptManager1.SetFocus(txtMessage); } }
protected void Page_Load(object sender, EventArgs e) { ScriptManager1.RegisterAsyncPostBackControl(lkbQuit);//注册退出按钮,控制上方用户名/退出按钮异步刷新 //更新首页上的用户名 if (Session["User"] != null) { Customer customer = (Customer)Session["User"]; lblNameInput.Text = customer.Name; } }
protected void Wizard1_ActiveStepChanged(object sender, EventArgs e) { // Проверить, что это асинхронная обратная отправка, // а не попытка выполнить навигацию if ((ScriptManager1.IsInAsyncPostBack) && (!ScriptManager1.IsNavigating)) { string currentStep = Wizard1.ActiveStepIndex.ToString(); ScriptManager1.AddHistoryPoint("Wizard1", Wizard1.ActiveStepIndex.ToString(), "Шаг " + (Wizard1.ActiveStepIndex + 1).ToString()); } }
protected void Page_Load(object sender, EventArgs e) { ScriptManager1.RegisterAsyncPostBackControl(addRow); if (ViewState["count"] != null) { for (int i = 0; i < Convert.ToInt16(ViewState["count"]); i++) { addNewRow(); } } }
protected void Page_Init(object sender, EventArgs e) { if (!IsPostBack) { this.ClearSession(this.ID); } this.InitializeControls(); this.LoadValuesFromSession(); this.BindGridView(); ScriptManager1.RegisterAsyncPostBackControl(ProductGridView); }
protected void ddActions_SelectedIndexChanged(object sender, EventArgs e) { ////for broswer back button if (ScriptManager1.IsInAsyncPostBack && !ScriptManager1.IsNavigating) { ScriptManager1.AddHistoryPoint("historyPoint", ddActions.SelectedIndex.ToString(), ddActions.SelectedValue); } hideAllCU(); if (ddActions.SelectedValue.ToString().ToLower().Trim() == "Find".ToLower()) { find.Visible = true; } if (ddActions.SelectedValue.ToString().ToLower().Trim() == "Song Number".ToLower()) { songNumber.Visible = true; } if (ddActions.SelectedValue.ToString().ToLower().Trim() == "Waiting List".ToLower()) { currentList1.Visible = true; } if (ddActions.SelectedValue.ToString().ToLower().Trim() == "Video".ToLower()) { video.Visible = true; } if (ddActions.SelectedValue.ToString().ToLower().Trim() == "Volume".ToLower()) { volume.Visible = true; } if (ddActions.SelectedValue.ToString().ToLower().Trim() == "Tune".ToLower()) { tune.Visible = true; } if (ddActions.SelectedValue.ToString().ToLower().Trim() == "advanced".ToLower()) { advanced.Visible = true; } }