using System; using System.Data; using System.Configuration; using System.Collections; 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 partial class Subpage : System.Web.UI.MasterPage { private string _SiteUrl = null; public string SiteUrl { get { if (_SiteUrl == null) { if (Request.IsLocal || ConfigurationManager.AppSettings["ForceWWWRedirect"] == "false") { _SiteUrl = String.Format("http://{0}{1}/", Request.Url.Authority, (Request.ApplicationPath.Length == 1 ? "" : Request.ApplicationPath)); } else if (Request.IsSecureConnection) { if (!Request.Url.Authority.StartsWith("www")) _SiteUrl = String.Format("https://www.{0}{1}/", Request.Url.Authority, (Request.ApplicationPath.Length == 1 ? "" : Request.ApplicationPath)); else _SiteUrl = String.Format("https://{0}{1}/", Request.Url.Authority, (Request.ApplicationPath.Length == 1 ? "" : Request.ApplicationPath)); } else { if (!Request.Url.Authority.StartsWith("www")) _SiteUrl = String.Format("http://www.{0}{1}/", Request.Url.Authority, (Request.ApplicationPath.Length == 1 ? "" : Request.ApplicationPath)); else _SiteUrl = String.Format("http://{0}{1}/", Request.Url.Authority, (Request.ApplicationPath.Length == 1 ? "" : Request.ApplicationPath)); } } return _SiteUrl; } } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { // grab the attributes DataTable dt = DatabaseClass.Current.Attributes_GetAll(); dlOccasions.DataSource = dt; dlOccasions.DataBind(); } } }