This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title> | |
<use content="page-title"/> | |
</title> | |
<link href="../../Content/Site.css" rel="stylesheet" type="text/css" /> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<if condition="Request.IsAuthenticated"> | |
Welcome <b> ${ Context.User.Identity.Name }</b>! | |
[ !{ Html.ActionLink("Log Off","LogOff", "Account") } ] | |
</if> | |
<else> | |
[ !{ Html.ActionLink("Log On","LogOn","Account") } ] | |
</else> | |
<span class="Apple-style-span" style="font-family: Arial, Verdana, sans-serif; white-space: normal; ">Now lets edit Index.aspx and BookList.aspx change both extensions to .spark and edit as follows: Index.spark</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<content name="page-title"> | |
Home Page | |
</content> | |
<content name="main-content"> | |
<h2>${ ViewData["Message"] }</h2> | |
<p> | |
To learn more about ASP.NET MVC visit <a href="http://asp.net/mvc" title="ASP.NET MVC Website">http://asp.net/mvc</a>. | |
</p> | |
</content> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<viewdata model="IEnumerable<Book>" /> | |
<content name="page-title"> | |
BookList | |
</content> | |
<content name="main-content"> | |
<h2>BookList</h2> | |
<div each="var book in Model"> | |
Book Id: ${ book.Id } <br /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<viewdata model="ChangePasswordModel" PasswordLength="int" /> | |
<use master="" /> | |
<content name="page-title"> | |
Change Password | |
</content> | |
<content name="main-content"> | |
<h2>Change Password</h2> | |
<p> | |
Use the form below to change your password. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<use master="" /> | |
<content name="page-title"> | |
Change Password | |
</content> | |
<content name="main-content"> | |
<h2>Change Password</h2> | |
<p> | |
Your password has been changed successfully. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<viewdata model="LogOnModel" /> | |
<use master="" /> | |
<content name="page-title"> | |
Register | |
</content> | |
<content name="main-content"> | |
<h2>Log On</h2> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<viewdata model="RegisterModel" PasswordLength="int" /> | |
<use master="" /> | |
<content name="page-title"> | |
Register | |
</content> | |
<content name="main-content"> | |
<h2>Create a New Account</h2> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class AccountValidation | |
{ | |
public static string ErrorCodeToString(MembershipCreateStatus createStatus) | |
{ | |
// See http://go.microsoft.com/fwlink/?LinkID=177550 for | |
// a full list of status codes. | |
switch (createStatus) | |
{ | |
case MembershipCreateStatus.DuplicateUserName: | |
return "Username already exists. Please enter a different user name."; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public sealed class PropertiesMustMatchAttribute : ValidationAttribute | |
{ | |
private const string _defaultErrorMessage = "'{0}' and '{1}' do not match."; | |
private readonly object _typeId = new object(); | |
public PropertiesMustMatchAttribute(string originalProperty, string confirmProperty) | |
: base(_defaultErrorMessage) | |
{ | |
OriginalProperty = originalProperty; | |
ConfirmProperty = confirmProperty; |