-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
310 additions
and
183 deletions.
There are no files selected for viewing
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
27 changes: 14 additions & 13 deletions
27
src/ExpressiveAnnotations.MvcWebSample/Views/Home/EditorTemplates/Contact.cshtml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,29 @@ | ||
@model ExpressiveAnnotations.MvcWebSample.Models.Contact | ||
|
||
<fieldset> | ||
<legend>Contact details</legend> | ||
<ol> | ||
<li> | ||
<pre class="code"> | ||
<ol> | ||
<li> | ||
<pre class="code"> | ||
[RequiredIf("Phone == null")] | ||
[AssertThat("IsEmail(Email)")] | ||
</pre> | ||
<pre class="action">[show attribute]</pre> | ||
<pre class="action">[show attribute]</pre> | ||
<div> | ||
@Html.LabelFor(model => model.Email, new { @class = "inline prefix" }) | ||
@Html.EditorFor(model => model.Email) | ||
@Html.ValidationMessageFor(model => model.Email) | ||
</li> | ||
<li> | ||
<pre class="code"> | ||
</div> | ||
</li> | ||
<li> | ||
<pre class="code"> | ||
[RequiredIf("Email == null")] | ||
[AssertThat("IsDigitChain(Phone)")] | ||
[AssertThat("Length(Phone) > 8 && Length(Phone) < 16")] | ||
</pre> | ||
<pre class="action">[show attribute]</pre> | ||
<pre class="action">[show attribute]</pre> | ||
<div> | ||
@Html.LabelFor(model => model.Phone, new { @class = "inline prefix" }) | ||
@Html.EditorFor(model => model.Phone) | ||
@Html.ValidationMessageFor(model => model.Phone) | ||
</li> | ||
</ol> | ||
</fieldset> | ||
</div> | ||
</li> | ||
</ol> |
4 changes: 3 additions & 1 deletion
4
src/ExpressiveAnnotations.MvcWebSample/Views/Home/EditorTemplates/ISO8601Date.cshtml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
@model DateTime | ||
@Html.Hidden("", Model.ToString ("s", System.Globalization.CultureInfo.InvariantCulture)) @*toString with s (sortable) format returns strict ISO 8601*@ | ||
@Html.Hidden("", Model.ToString ("o", System.Globalization.CultureInfo.InvariantCulture)) @*From MSDN: The "o" standard format specifier represents a custom date and time format | ||
string using a pattern that preserves time zone information and emits a result string | ||
that complies with ISO 8601*@ |
Oops, something went wrong.