Send mail to the author(s) E-mail

# Monday, 02 April 2012

How to do this elegantly?


Could use the AspNetMembershipProvider.  Just  need to put in a MembersOnly.aspx page into account and it all works.


However this is complex.  I only want a single username and password to to get to the MembersOnly page and no backend db.  Ideally I’d also like this to be testable too.

Publish to Amazon EC2

Simplest thing is to publish my website in VS2010 to my filesystem, then copy paste the files up to EC2 using remote desktop.

Had to set the default app pool to .NET4 (advanced settings in IIS Manager)


and to set write permissions on a newly created App_Data folder for


SQL Express problems on the server

Changed web.config on the server to point to IP-0AEB5367 instead of .\SQLEXPRESS


Changed   application pool identity to network service.


public partial class Login : System.Web.UI.Page
        //wired up from the control
        protected void OnAuthenticate(object sender, AuthenticateEventArgs e)
            if ((LoginUser.UserName == "dave") && (LoginUser.Password == "letmein"))
                e.Authenticated = true;
                e.Authenticated = false;

        //so if a user links to Secure/Page3.aspx they are redirected to Page2.aspx on successful login
        protected void OnLoggedIn(object sender, EventArgs e)

and on the login control:

onauthenticate="OnAuthenticate" OnLoggedIn="OnLoggedIn"
| | #