Appendix: Using the LOGIN Element Tag
If you want to restrict some or all of your website to logged-in users you will need to provide a means for them to log in. This can be done by adding a User Login page, which allows users to log in to the site by entering their details. When a user logs in they will be able to access pages whose accessibility has been set to Authenticated, which are not visible to guest users.
This element tag has the following default syntax:
<%# LOGIN() %>
You can create a new page with a Login tag already added to its markup by opening the Site Map Inspector and selecting File > New > Pages > User Login.
You can leave this as it is if you want to use the element tag's default settings, however there is a series of extended properties that you can edit to customise the look and functionality of the login control. The following syntax shows all of the these optional parameters:
<%# LOGIN(
UsernameLabel
PasswordLabel
ButtonText
IsForgottenPasswordVisible
Redirect_PageLink) %>
If you omit a property, the default value will be used.
UsernameLabel is the text you want to display next to the user name field. Its default value is "User Name".
PasswordLabel is the text you want to display next to the password field. Its default value is "Password".
ButtonText determines the label text of the button. Its default value is "Login".
IsForgottenPasswordVisible is a Boolean value that determines if the control should include a "Forgotten Password" link. The default value is "True".
Redirect_PageLink can be used to determine which page the user should see after they have signed in, according on their user role. Replace the "PageLink" component with the name of a suitable page link, and enter a character-separated list of user roles that should be taken to this page. You can add any number of redirect properties, which will be evaluated in order. Take the following example:
<%# LOGIN(
UsernameLabel="User Name"
PasswordLabel="Password"
ButtonText="Login"
IsForgottenPasswordVisible="true"
Redirect_HomePage="Employee"
Redirect_AdminPage="Admin") %>
If a user has been assigned to both the "Employee" and "Admin" user roles, they will be taken to the "HomePage" because that link appears first. If you want them to instead see "AdminPage" after they sign in, you need to swap the redirect properties around.