|
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Configuration;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Ventaur.Web.Security;
using Ventaur.Web.Security.Configuration;
/// <summary>
/// Summary description for BasePage
/// </summary>
public class BasePage : Page {
public override string StyleSheetTheme {
get {
string Result = string.Empty;
SecureWebPageSettings Settings = WebConfigurationManager.GetSection("secureWebPages") as SecureWebPageSettings;
bool IsSecure = (Request.Url.Query == "?Secure");
if (IsSecure)
Result = "Secure";
else {
switch (RequestEvaluator.Evaluate(Request, Settings)) {
case SecurityType.Secure:
Response.Redirect(Request.Url.AbsolutePath + "?Secure");
break;
case SecurityType.Insecure:
Result = "Standard";
break;
default:
if (Request.UrlReferrer.Query == "?Secure")
Response.Redirect(Request.Url.AbsolutePath + "?Secure");
else
Result = "Standard";
break;
}
}
if (Settings.EncryptedUri != null && Settings.EncryptedUri != string.Empty) {
if (Result == "Standard")
Response.Write(SSLHelper.DetermineUnsecurePage(Settings, true));
else
Response.Write(SSLHelper.DetermineSecurePage(Settings, true));
}
return Result;
}
}
public BasePage() : base() {
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I began programming on my Commodore 64 at around the age of 12. After migrating to DOS and then Windows, I decided to take on the Web. Several languages and platforms later, I have settled in with .NET nicely. I am currently the owner of a software consulting company and lead application developer for a learning-based technology consultation company.
The love of a finished application is usually at war with the desire to improve it as soon as it's released (they're never really finished).