Guest User

Untitled

a guest
Oct 18th, 2017
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.72 KB | None | 0 0
  1. @inherits Umbraco.Web.Macros.PartialViewMacroPage
  2.  
  3.  
  4. @using System.Web.Mvc.Html
  5. @using ClientDependency.Core.Mvc
  6. @using Umbraco.Web
  7. @using Umbraco.Web.Models
  8. @using Umbraco.Web.Controllers
  9.  
  10. @{
  11.     var loginModel = new LoginModel();
  12.    
  13.     Html.EnableClientValidation();
  14.     Html.EnableUnobtrusiveJavaScript();
  15.     Html.RequiresJs("/umbraco_client/ui/jquery.js");
  16.     Html.RequiresJs("/umbraco_client/Application/JQuery/jquery.validate.min.js");
  17.     Html.RequiresJs("/umbraco_client/Application/JQuery/jquery.validate.unobtrusive.min.js");
  18. }
  19.  
  20. @* NOTE: This RenderJsHere code should be put on your main template page where the rest of your script tags are placed *@
  21. @Html.RenderJsHere()
  22.  
  23. @using (Html.BeginUmbracoForm<UmbLoginController>("HandleLogin"))
  24. {
  25.     <fieldset>
  26.         <legend>Login</legend>
  27.        
  28.         @Html.ValidationSummary("loginModel", true)
  29.  
  30.         @Html.LabelFor(m => loginModel.Username)
  31.         @Html.TextBoxFor(m => loginModel.Username)
  32.         @Html.ValidationMessageFor(m => loginModel.Username)
  33.         <br />
  34.  
  35.         @Html.LabelFor(m => loginModel.Password)
  36.         @Html.PasswordFor(m => loginModel.Password)
  37.         @Html.ValidationMessageFor(m => loginModel.Password)
  38.         <br />
  39.  
  40.         <button>Login</button>
  41.     </fieldset>  
  42. }
  43.  
  44.  
  45.  
  46. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  47.  
  48.  
  49.  
  50. @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
  51.  
  52.  
  53. @using System.Web.Mvc.Html
  54. @using ClientDependency.Core.Mvc
  55. @using Umbraco.Web
  56. @using Umbraco.Web.Models
  57. @using Umbraco.Web.Controllers
  58.  
  59.  
  60.  
  61. @{
  62.     var loginNodeID = 1244;
  63.     var loginModel = new LoginModel();
  64.     var loginStatusModel = Members.GetCurrentLoginStatus();
  65.  
  66.     loginModel.RedirectUrl = "/";
  67.  
  68.  
  69.  
  70. }
  71.  
  72.  
  73.  
  74. @using (Html.BeginUmbracoForm<UmbLoginController>("HandleLogin"))
  75. {
  76.  
  77.  
  78.             <h3 class="page-header">Logg inn</h3>  
  79.              @Html.ValidationSummary("loginModel", true)    
  80.     <div>
  81.  
  82.               <div class="form-group">
  83.                 @Html.LabelFor(m => loginModel.Username)
  84.         @Html.TextBoxFor(m => loginModel.Username, new { @placeholder = "Username", @class="form-control" })
  85.         @Html.ValidationMessageFor(m => loginModel.Username)  
  86.  
  87.               </div>
  88.               <div class="form-group">
  89.                     @Html.LabelFor(m => loginModel.Password)
  90.         @Html.PasswordFor(m => loginModel.Password, new { @placeholder = "Password", @class="form-control" })
  91.         @Html.ValidationMessageFor(m => loginModel.Password)
  92.                 </div>
  93.                   @Html.HiddenFor(m => loginModel.RedirectUrl)
  94.                <button  class="btn btn-primary">Login</button>
  95.             </div>  
  96.  
  97.  
  98. }
Advertisement
Add Comment
Please, Sign In to add comment