void context_PostRequestHandlerExecute(object sender, EventArgs e) { HttpContext context = ((HttpApplication)sender).Context; if (context.CurrentHandler is Page) { PageOptimizer.Compress(context); } }
protected void Page_PreRender(object sender, EventArgs e) { PageOptimizer.CombineCss(this); //Установка стиля string ImagesDir = string.Format("~/Resources_Design/{0}/Images/", ApplicationManager.GetProjectName()); Button_Enter.ImageUrl = ImagesDir + "Button_enter.png"; }
protected void Page_Init(object sender, EventArgs e) { PageOptimizer.CombineCss(this); //Установка скина string ImagesDir = string.Format("~/Resources_Design/{0}/Images/", ApplicationManager.GetProjectName()); ButtonExit.ImageUrl = ImagesDir + "Exit.png"; Img_Profile.Src = ImagesDir + "Button_profile.png"; Img_Uchrejdenie.Src = ImagesDir + "Button_uchr.png"; Img_Users.Src = ImagesDir + "Button_users.png"; Img_Caption.Src = ImagesDir + "Caption.png"; Img_forms.Src = ImagesDir + "Button_forms.jpg"; Img_analitic.Src = ImagesDir + "Button_analitic.jpg"; RadWindowManager1.Skin = "BarsBlue"; if (Барс.Ядро.МенеджерПользователей.ТекущийПользователь == null) { Response.Redirect("~/Login.aspx"); return; } string названиеУчреждения = "Учреждение не указано"; if (Барс.ПеременныеСессии.ТекущееУчреждение != null) { названиеУчреждения = Барс.ПеременныеСессии.ТекущееУчреждение.Наименование; } RadWindowManager1.Behavior = RadWindowBehaviorFlags.Close | RadWindowBehaviorFlags.Reload; UserInfo.Controls.Add(new LiteralControl(названиеУчреждения + "/<br/>" + Барс.Ядро.МенеджерПользователей.ТекущийПользователь.Наименование)); Row_Users.Visible = Барс.Ядро.МенеджерПользователей.ТекущийПользователь.ольПользователя == "Администратор"; Row_Users2.Visible = Барс.Ядро.МенеджерПользователей.ТекущийПользователь.ольПользователя == "Администратор"; }
public void ProcessRequest(HttpContext context) { if (!string.IsNullOrEmpty(context.Request.QueryString["stylesheets"])) { string[] relativeFiles = context.Request.QueryString["stylesheets"].Split(','); string[] absoluteFiles = new string[relativeFiles.Length]; for (int i = 0; i < relativeFiles.Length; i++) { string file = relativeFiles[i]; if (file.EndsWith(".css")) { file = file.Replace("#ThemePath#", "Resources_Design/" + ApplicationManager.GetProjectName()); string absoluteFile = context.Server.MapPath(file); WriteContent(context, absoluteFile); absoluteFiles[i] = absoluteFile; } } SetHeaders(context, absoluteFiles); PageOptimizer.Compress(context); } }
/// <summary> /// Enables processing of HTTP Web requests by a custom /// HttpHandler that implements the <see cref="T:System.Web.IHttpHandler"></see> interface. /// </summary> /// <param name="context">An <see cref="T:System.Web.HttpContext"></see> object that provides /// references to the intrinsic server objects /// (for example, Request, Response, Session, and Server) used to service HTTP requests. /// </param> public void ProcessRequest(HttpContext context) { string root = context.Request.Url.GetLeftPart(UriPartial.Authority); string path = context.Request.QueryString["path"]; string content = string.Empty; List <string> localFiles = new List <string>(); if (!string.IsNullOrEmpty(path)) { string[] scripts = path.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries); foreach (string script in scripts) { content += "/*---" + script + "---*/"; // We only want to serve resource files for security reasons. if (script.Contains("Resource.axd") || script.Contains("asmx/js") || script.StartsWith("http", StringComparison.OrdinalIgnoreCase)) { content += RetrieveRemoteScript(root + script) + Environment.NewLine; } else { content += RetrieveLocalScript(script, localFiles) + Environment.NewLine; } } //content = StripWhitespace(content); } if (!string.IsNullOrEmpty(content)) { context.Response.Write(content); SetHeaders(context, localFiles.ToArray()); PageOptimizer.Compress(context); } }