Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @inherits Umbraco.Web.Macros.PartialViewMacroPage
- @using System.Web.Mvc.Html
- @using ClientDependency.Core.Mvc
- @using Umbraco.Web
- @using Umbraco.Web.Models
- @using Umbraco.Web.Controllers
- @{
- var loginModel = new LoginModel();
- Html.EnableClientValidation();
- Html.EnableUnobtrusiveJavaScript();
- Html.RequiresJs("/umbraco_client/ui/jquery.js");
- Html.RequiresJs("/umbraco_client/Application/JQuery/jquery.validate.min.js");
- Html.RequiresJs("/umbraco_client/Application/JQuery/jquery.validate.unobtrusive.min.js");
- }
- @* NOTE: This RenderJsHere code should be put on your main template page where the rest of your script tags are placed *@
- @Html.RenderJsHere()
- @using (Html.BeginUmbracoForm<UmbLoginController>("HandleLogin"))
- {
- <fieldset>
- <legend>Login</legend>
- @Html.ValidationSummary("loginModel", true)
- @Html.LabelFor(m => loginModel.Username)
- @Html.TextBoxFor(m => loginModel.Username)
- @Html.ValidationMessageFor(m => loginModel.Username)
- <br />
- @Html.LabelFor(m => loginModel.Password)
- @Html.PasswordFor(m => loginModel.Password)
- @Html.ValidationMessageFor(m => loginModel.Password)
- <br />
- <button>Login</button>
- </fieldset>
- }
- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
- @using System.Web.Mvc.Html
- @using ClientDependency.Core.Mvc
- @using Umbraco.Web
- @using Umbraco.Web.Models
- @using Umbraco.Web.Controllers
- @{
- var loginNodeID = 1244;
- var loginModel = new LoginModel();
- var loginStatusModel = Members.GetCurrentLoginStatus();
- loginModel.RedirectUrl = "/";
- }
- @using (Html.BeginUmbracoForm<UmbLoginController>("HandleLogin"))
- {
- <h3 class="page-header">Logg inn</h3>
- @Html.ValidationSummary("loginModel", true)
- <div>
- <div class="form-group">
- @Html.LabelFor(m => loginModel.Username)
- @Html.TextBoxFor(m => loginModel.Username, new { @placeholder = "Username", @class="form-control" })
- @Html.ValidationMessageFor(m => loginModel.Username)
- </div>
- <div class="form-group">
- @Html.LabelFor(m => loginModel.Password)
- @Html.PasswordFor(m => loginModel.Password, new { @placeholder = "Password", @class="form-control" })
- @Html.ValidationMessageFor(m => loginModel.Password)
- </div>
- @Html.HiddenFor(m => loginModel.RedirectUrl)
- <button class="btn btn-primary">Login</button>
- </div>
- }
Advertisement
Add Comment
Please, Sign In to add comment