114 lines
3.4 KiB
C#
114 lines
3.4 KiB
C#
using System;
|
|
using System.Data;
|
|
using System.Configuration;
|
|
using System.Web;
|
|
using System.Web.Security;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
using System.Web.UI.WebControls.WebParts;
|
|
using System.Web.UI.HtmlControls;
|
|
|
|
|
|
public class BaseThemePage : System.Web.UI.Page
|
|
{
|
|
protected override void OnPreInit(EventArgs e)
|
|
{
|
|
Util.SetUserLocale();
|
|
base.OnPreInit(e);
|
|
//if (Request != null)
|
|
//{
|
|
// if (Request.Cookies["Theme"] == null)
|
|
// {
|
|
// Response.Cookies["Theme"].Value = "Default";
|
|
// Response.Cookies["Theme"].Expires = DateTime.Now.AddYears(30);
|
|
// Page.Theme = "Default";
|
|
// }
|
|
// else
|
|
// {
|
|
// Page.Theme = ((string)Request.Cookies["Theme"].Value);
|
|
// }
|
|
//}
|
|
|
|
////Test built in themes in new ajax controls
|
|
//Page.Theme = "Sunset";
|
|
|
|
}
|
|
|
|
protected override void OnLoad(EventArgs e)
|
|
{
|
|
|
|
//Place code here that should be called before the inheriting page's onload is executed
|
|
|
|
|
|
|
|
//case 1651
|
|
string sIE9ForceCompatibility = System.Configuration.ConfigurationManager.AppSettings["IE9ForceCompatbilityMode"];
|
|
if (!string.IsNullOrWhiteSpace(sIE9ForceCompatibility))
|
|
{
|
|
if (sIE9ForceCompatibility.ToLower() == "true")
|
|
{
|
|
HtmlMeta meta = new HtmlMeta();
|
|
meta.HttpEquiv = "X-UA-Compatible";
|
|
meta.Content = "IE=8";
|
|
this.Header.Controls.Add(meta);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
base.OnLoad(e);
|
|
if (!IsAjaxCallback)
|
|
{
|
|
if (this.Context.Session != null)
|
|
Util.SessionAddKeepAlive(this.Page);
|
|
}
|
|
Literal l = new Literal();
|
|
l.Text = "<link rel=\"stylesheet\" href=\"aya.css\" type=\"text/css\" />";
|
|
l.ID = "aya";
|
|
if (Page.Header.FindControl(l.ID) == null)
|
|
Page.Header.Controls.Add(l);
|
|
|
|
//case 1111
|
|
Util.PageAddCustomContent(this.Page);
|
|
|
|
|
|
}
|
|
|
|
protected void CloseMe()
|
|
{
|
|
//this causes the original window to refresh, useful if record has changed
|
|
//Response.Write("<script language=\"JavaScript\">window.opener.location.reload();</script>");
|
|
// Response.Write("<script language=\"JavaScript\">window.setTimeout('window.close()',10);</script>");
|
|
|
|
|
|
//Response.Write("<script language=\"JavaScript\">window.close();</script>");
|
|
//This version works around the IE7 tab close warning, that the above one generates
|
|
Response.Write("<script type=\"text/javascript\"> window.open('','_parent',''); window.close(); </script> ");
|
|
|
|
}
|
|
|
|
private bool checkedforcallback = false;
|
|
private bool iscallback = false;
|
|
public bool IsAjaxCallback
|
|
{
|
|
get
|
|
{
|
|
if (!checkedforcallback)
|
|
{
|
|
iscallback = Page.IsCallback;
|
|
//HttpContext ctx = HttpContext.Current;
|
|
|
|
//iscallback = (
|
|
// ctx != null &&
|
|
// ctx.Request != null &&
|
|
// (ctx.Request.QueryString["rcbID"] != null ||
|
|
// ctx.Request.Form["RadAJAXControlID"] != null));
|
|
checkedforcallback = true;
|
|
}
|
|
return iscallback;
|
|
}
|
|
}
|
|
|
|
} |