Created
May 15, 2018 17:40
-
-
Save WrackedFella/75adc0761387d8acf8a2a77530c36933 to your computer and use it in GitHub Desktop.
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
@model object | |
@if (!ViewData.ModelState.IsValid) | |
{ | |
<div class="row alert alert-danger alert-dismissible fade show" role="alert"> | |
<div class="col-lg-auto mr-auto my-auto"> | |
@Html.ValidationSummary(true) | |
</div> | |
<div class="col-lg-auto"> | |
<button type="button" class="close" data-dismiss="alert" aria-label="Close"> | |
<span aria-hidden="true">×</span> | |
</button> | |
</div> | |
</div> | |
} | |
<div class="form-row"> | |
@*@{ bool flag = false; }*@ | |
@foreach (var property in ViewData.ModelMetadata.Properties.Where(x => x.ShowForEdit)) | |
{ | |
if (property.TemplateHint == "HiddenInput") | |
{ | |
@Html.Hidden(property.PropertyName) | |
continue; | |
} | |
<div class="form-group @(property.DataTypeName == "MultilineText" ? "col-lg-12" : "col-lg-6")"> | |
@if (property.ModelType.Name != "Boolean") | |
{ | |
<label class="col-form-label" for="@property.PropertyName"> | |
@(property.DisplayName ?? property.PropertyName) | |
</label> | |
} | |
@if (property.TemplateHint == "ReadOnly") | |
{ | |
<span class="form-text"> | |
@(String.Format(property.DisplayFormatString ?? "{0}", property.Model)) | |
</span> | |
} | |
else | |
{ | |
@Html.Editor(property.PropertyName) | |
} | |
@Html.ValidationMessage(property.PropertyName, new { @class = "text-danger" }) | |
</div> | |
@*if (flag) | |
{ | |
@Html.Raw("</div><div class='form-row'>"); | |
} | |
flag = !flag;*@ | |
} | |
</div> | |
<script> | |
$(document).ready(function () { | |
$(".jsPhoneNumber").mask("(999) 999-9999"); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment