public String[,] getSiteMapArray() { site_utils nsite_utils = new site_utils(); String[,] siteMapArray = new String[nsite_utils.getSiteMapPath(main_top_menu, main_top_menu.SelectedItem).GetUpperBound(0) + 1, 2]; siteMapArray = nsite_utils.getSiteMapPath(main_top_menu, main_top_menu.SelectedItem); return(siteMapArray); }
protected void Page_PreInit(Object sender, EventArgs e) { if (!((Server.MachineName == "YURY") && (Page.MasterPageFile == "/SUPPORT/MyPage.master"))) { site_utils PageAttr = new site_utils(); PageAttr.setPageAttr(this.Page); } }
protected void Page_Load(object sender, EventArgs e) { site_utils nsite_utils = new site_utils(); nsite_utils.RegisterClientId(this.Page, clockexam_bel); nsite_utils.RegisterClientId(this.Page, clockexam_usa); f_Lbl1.Text = DateTime.Today.Year.ToString(); UserName.Text = "Account owner: " + (string)Session["UserIdOwner"]; LastVisit.Text = "Last visit: " + (string)Session["LastVisit"]; FromIP.Text = "From IP: " + (string)Session["FromIP"]; LogOut.Text = "LogOut"; }
protected void Page_PreInit(Object sender, EventArgs e) { if (Server.MachineName == "YURY") { Page.MasterPageFile = pathToMasterPage2; } else { Page.MasterPageFile = pathToMasterPage1; } if (!( (Server.MachineName == "YURY") && ((Page.MasterPageFile == "/SUPPORT/MyPage.master") || (Page.MasterPageFile == "/investars.support/MyPage.master") ) ) ) { site_utils PageAttr = new site_utils(); PageAttr.setPageAttr(this.Page); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { DataSet MenuDateSet = (DataSet)Session["MenuDataSet"]; int userId = (int)Session["UserId"]; site_utils nsite_utils = new site_utils(); if (MenuDateSet == null) { Session["MenuDataSet"] = nsite_utils.getMenuDataSet(userId); MenuDateSet = (DataSet)Session["MenuDataSet"]; } nsite_utils.setUserMenu(this.Page, main_top_menu, MenuDateSet, userId); } if (main_top_menu.Items.Count != 0) { string mvp = (string)Session["mvp"]; if (mvp != null) { if (main_top_menu.FindItem(mvp).Selectable) { main_top_menu.FindItem(mvp).Selected = true; } } setSiteMapObject(Page.Master.FindControl("map_panel"), getSiteMapArray()); } else { Label newLbl = new Label(); newLbl.ID = "newLbl"; newLbl.Text = "We are sorry, but no any menu configuration settings for the current user."; Page.Master.FindControl("map_panel").Controls.Add(newLbl); } }
protected void Page_PreInit(Object sender, EventArgs e) { site_utils PageAttr = new site_utils(); PageAttr.setPageAttr(this.Page); }
protected void Page_Load(object sender, EventArgs e) { cLbl.Text = DateTime.Today.Year.ToString(); if (Request.QueryString["goBackTo"] != null) { goBackTo.Value = Request.QueryString["goBackTo"]; } if (Request.Form.Get("Action") != null) { if (Request.Form.Get("Action") == "Login") { string currPage = null; if (Request.Form.Get("goBackTo") != null) { site_utils su = new site_utils(); currPage = su.getSitePage(Request.Form.Get("goBackTo")); } SqlParameter[] paramArray = new SqlParameter[5]; SqlParameter param1 = new SqlParameter("@UserName", SqlDbType.NVarChar, 50); param1.Value = Request.Form.Get("UserId"); paramArray[0] = param1; SqlParameter param2 = new SqlParameter("@Password", SqlDbType.NVarChar, 50); param2.Value = Request.Form.Get("Password");; paramArray[1] = param2; SqlParameter param3 = new SqlParameter("@IP", SqlDbType.NVarChar, 20); param3.Value = Request.UserHostAddress.ToString(); paramArray[2] = param3; SqlParameter param4 = new SqlParameter("@Browser", SqlDbType.NVarChar, 100); param4.Value = Request.UserAgent.ToString(); paramArray[3] = param4; SqlParameter param5 = new SqlParameter("@Page", SqlDbType.NVarChar, 200); param5.Value = currPage; paramArray[4] = param5; db_utils ndb_utils = new db_utils(); SqlDataReader reader = ndb_utils.get_db_Data("site_get_userid", paramArray, "Reader") as SqlDataReader; reader.Read(); if ((int)reader["UserId"] != -1) { Session["UserId"] = reader["UserId"]; Session["UserIdOwner"] = reader["IdOwner"]; Session["UserEmail"] = reader["Email"]; Session["LastVisit"] = reader["LastVisit"]; Session["FromIP"] = reader["FromIP"]; if (reader["DefRedirectPage"].ToString() == "goBackTo") { Response.Redirect(Request.Form.Get("goBackTo")); } else { Response.Redirect(reader["DefRedirectPage"].ToString()); } } else { mesLbl.Text = reader["MessageToUser"].ToString(); } } } }