Skip to content

Instantly share code, notes, and snippets.

@loudej
Created April 12, 2012 21:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save loudej/2371061 to your computer and use it in GitHub Desktop.
Save loudej/2371061 to your computer and use it in GitHub Desktop.
".shade" left-offset spark syntax
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>@ViewBag.Title</title>
<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"></script>
</head>
<body>
<div class="page">
<header>
<div id="title">
<h1>My MVC Application</h1>
</div>
<div id="logindisplay">
@Html.Partial("_LogOnPartial")
</div>
<nav>
<ul id="menu">
<li>@Html.ActionLink("Home", "Index", "Home")</li>
<li>@Html.ActionLink("About", "About", "Home")</li>
</ul>
</nav>
</header>
<section id="main">
@RenderBody()
</section>
<footer>
</footer>
</div>
</body>
</html>
html
head
meta charset="utf-8"
title =ViewBag.Title
link href="~/Content/Site.css" rel="stylesheet" type="text/css"
script src="~/Scripts/jquery-1.5.1.min.js" type="text/javascript" |
script src="~/Scripts/modernizr-1.7.min.js" type="text/javascript" |
body div.page
header
#title h1 |My MVC Application
#logindisplay LogOnPartial
nav ul#menu
li a controller="Home" action="Index" |Home
li a controller="Home" action="About" |About
section#main use content="view"
footer
@{
ViewBag.Title = "Home Page";
}
<h2>@ViewBag.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>
-ViewBag.Title = "Home Page";
h2 =ViewBag.Message
p
|To learn more about ASP.NET MVC visit
a href="http://asp.net/mvc" title="ASP.NET MVC Website" |http://asp.net/mvc
|.
@model MvcApplication4.Models.RegisterModel
@{
ViewBag.Title = "Register";
}
<h2>Create a New Account</h2>
<p>
Use the form below to create a new account.
</p>
<p>
Passwords are required to be a minimum of @Membership.MinRequiredPasswordLength characters in length.
</p>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Html.BeginForm()) {
@Html.ValidationSummary(true, "Account creation was unsuccessful. Please correct the errors and try again.")
<div>
<fieldset>
<legend>Account Information</legend>
<div class="editor-label">
@Html.LabelFor(m => m.UserName)
</div>
<div class="editor-field">
@Html.TextBoxFor(m => m.UserName)
@Html.ValidationMessageFor(m => m.UserName)
</div>
<div class="editor-label">
@Html.LabelFor(m => m.Email)
</div>
<div class="editor-field">
@Html.TextBoxFor(m => m.Email)
@Html.ValidationMessageFor(m => m.Email)
</div>
<div class="editor-label">
@Html.LabelFor(m => m.Password)
</div>
<div class="editor-field">
@Html.PasswordFor(m => m.Password)
@Html.ValidationMessageFor(m => m.Password)
</div>
<div class="editor-label">
@Html.LabelFor(m => m.ConfirmPassword)
</div>
<div class="editor-field">
@Html.PasswordFor(m => m.ConfirmPassword)
@Html.ValidationMessageFor(m => m.ConfirmPassword)
</div>
<p>
<input type="submit" value="Register" />
</p>
</fieldset>
</div>
}
viewdata model="MvcApplication4.Models.RegisterModel"
-ViewBag.Title = "Register";
h2 |Create a New Account
p |Use the form below to create a new account.
p |Passwords are required to be a minimum of ${Membership.MinRequiredPasswordLength} characters in length.
script src="~/Scripts/jquery.validate.min.js" type="text/javascript" |
script src="~/Scripts/jquery.validate.unobtrusive.min.js" type="text/javascript" |
-// This is making heavy use of Bindings.xml, of course, but you get the idea
Form
ValidationSummary ExcludePropertyErrors="true" |Account creation was unsuccessful. Please correct the errors and try again.
div fieldset
legend |Account Information
.editor-label Label For="UserName"
.editor-field
TextBox For="UserName"
ValidationMessage For="UserName"
.editor-label Label For="Email"
.editor-field
TextBox For="Email"
ValidationMessage For="Email"
.editor-label Label For="Password"
.editor-field
Password For="Password"
ValidationMessage For="Password"
.editor-label Label For="ConfirmPassword"
.editor-field
Password For="ConfirmPassword"
ValidationMessage For="ConfirmPassword"
p input type="submit" value="Register"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment