Click here to Skip to main content
15,896,348 members
Articles / Web Development / XHTML

Fully configured ASP.NET Membership Website Template

Rate me:
Please Sign up or sign in to vote.
4.89/5 (18 votes)
7 Jul 2009CPOL4 min read 165.5K   8.3K   119  
A pre-configured ASP.NET website containing a Master page, error handling, login / logout, and other boilerplate new project code.
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI;
using System.Web.UI.HtmlControls;

/// <summary>
/// Summary description for BaseMasterPage
/// </summary>
public class BaseMasterPage : System.Web.UI.MasterPage
{
    #region Protected Fields

    protected HtmlControl App_Error;
    protected Label lblErrorMessage;

    protected HtmlControl App_Warning;
    protected Label lblWarningMessage;

    protected HtmlControl App_Information;
    protected Label lblInformationMessage;

    protected Menu mnuMain;
    protected SiteMapPath SiteMapPath1;

    #endregion

    #region Public Properties

    /// <summary>
    /// Sets the Application Level error essage.
    /// </summary>
    /// <value>The error message.</value>
    public string ErrorMessage
    {
        set
        {
            lblErrorMessage.Text = value.Replace("\n", "<br />");
            App_Error.Visible = true;
        }
    }

    public string WarningMessage
    {
        set
        {
            lblWarningMessage.Text = value.Replace("\n", "<br />");
            App_Warning.Visible = true;
        }
    }

    public string InformationMessage
    {
        set
        {
            lblInformationMessage.Text = value.Replace("\n", "<br />");
            App_Information.Visible = true;
        }
    }

    public Menu MainMenu { get { return mnuMain; } }

    public SiteMapPath SiteMapPath { get { return SiteMapPath1; } }

    #endregion

}

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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Harland Financial Solutions
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions