Advertisement
Guest User

Untitled

a guest
Sep 12th, 2019
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASP 4.88 KB | None | 0 0
  1. @model WebStore.Models.IndexViewModel
  2. @{
  3.     ViewBag.Title = "My Profile";
  4. }
  5.  
  6. <h2>@ViewBag.Title.</h2>
  7.  
  8. <p class="text-success">@ViewBag.StatusMessage</p>
  9. <div>
  10.     <h4>Change your account settings</h4>
  11.     <hr />
  12.     <dl class="dl-horizontal">
  13.         <dt>FirstName</dt>
  14.         <dd>@Html.TextBoxFor(m => Model.User.FirstName, new { @disabled = "disabled", @class = "personal" })</dd>
  15.         <dt>LastName</dt>
  16.         <dd>@Html.TextBoxFor(m => Model.User.LastName, new { @disabled = "disabled", @class = "personal" })</dd>
  17.         <dt>Country</dt>
  18.         <dd>@Html.TextBoxFor(m => Model.User.Country, new { @disabled = "disabled", @class = "personal" })</dd>
  19.         <dt>City</dt>
  20.         <dd>@Html.TextBoxFor(m => Model.User.City, new { @disabled = "disabled", @class = "personal" })</dd>
  21.         <dt>Street</dt>
  22.         <dd>@Html.TextBoxFor(m => Model.User.Street, new { @disabled = "disabled", @class = "personal" })</dd>
  23.         <dt>House</dt>
  24.         <dd>@Html.TextBoxFor(m => Model.User.House, new { @disabled = "disabled", @class = "personal" })</dd>
  25.         <dt>Building</dt>
  26.         <dd>@Html.TextBoxFor(m => Model.User.Building, new { @disabled = "disabled", @class = "personal" })</dd>
  27.         <dt>Password:</dt>
  28.         <dd>
  29.             [
  30.             @if (Model.HasPassword)
  31.             {
  32.                 @Html.ActionLink("Change your password", "ChangePassword")
  33.             }
  34.             else
  35.             {
  36.                 @Html.ActionLink("Create", "SetPassword")
  37.             }
  38.             ]
  39.         </dd>
  40.         <dt>External Logins:</dt>
  41.         <dd>
  42.             @Model.Logins.Count [
  43.             @Html.ActionLink("Manage", "ManageLogins") ]
  44.         </dd>
  45.         @*
  46.             Phone Numbers can used as a second factor of verification in a two-factor authentication system.
  47.  
  48.              See <a href="https://go.microsoft.com/fwlink/?LinkId=403804">this article</a>
  49.                 for details on setting up this ASP.NET application to support two-factor authentication using SMS.
  50.  
  51.              Uncomment the following block after you have set up two-factor authentication
  52.         *@
  53.         @*
  54.             <dt>Phone Number:</dt>
  55.             <dd>
  56.                 @(Model.PhoneNumber ?? "None")
  57.                 @if (Model.PhoneNumber != null)
  58.                 {
  59.                     <br />
  60.                     <text>[&nbsp;&nbsp;@Html.ActionLink("Change", "AddPhoneNumber")&nbsp;&nbsp;]</text>
  61.                     using (Html.BeginForm("RemovePhoneNumber", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
  62.                     {
  63.                         @Html.AntiForgeryToken()
  64.                         <text>[<input type="submit" value="Remove" class="btn-link" />]</text>
  65.                     }
  66.                 }
  67.                 else
  68.                 {
  69.                     <text>[&nbsp;&nbsp;@Html.ActionLink("Add", "AddPhoneNumber")
  70.                 }
  71.             </dd>
  72.         *@
  73.         <dt>Two-Factor Authentication:</dt>
  74.         <dd>
  75.             <p>
  76.                 Not implemented.
  77.             </p>
  78.             @*@if (Model.TwoFactor)
  79.                 {
  80.                     using (Html.BeginForm("DisableTwoFactorAuthentication", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
  81.                     {
  82.                         @Html.AntiForgeryToken()
  83.                         <text>Enabled
  84.                         <input type="submit" value="Disable" class="btn btn-link" />
  85.                         </text>
  86.                     }
  87.                 }
  88.                 else
  89.                 {
  90.                     using (Html.BeginForm("EnableTwoFactorAuthentication", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
  91.                     {
  92.                         @Html.AntiForgeryToken()
  93.                         <text>Disabled
  94.                         <input type="submit" value="Enable" class="btn btn-link" />
  95.                         </text>
  96.                     }
  97.                 }*@
  98.         </dd>
  99.     </dl>
  100.     <div class="form-group">
  101.         <div class="col-md-offset-2 col-md-10">
  102.             <input type="submit" class="btn btn-default" value="Сохранить" />
  103.             <input id ="submitbt" type="button" onclick="change()" class="btn btn-default" value="Редактировать" />
  104.         </div>
  105.     </div>
  106.     @*<button id="submitbt" disabled="disabled" type="submit">Сохранить</button>
  107.     <button onclick="change()">Редактировать</button>*@
  108. </div>
  109.  
  110. <script>
  111.     function change() {
  112.         var e = document.getElementsByClassName("personal");
  113.         var arr = Array.prototype.slice.call(e);
  114.         for (var i = 0; i < arr.length; i++) {
  115.             arr[i].disabled = false;
  116.             arr[i].classList.remove("personal");
  117.         }
  118.         var b = document.getElementById("submitbt");
  119.         b.disabled = false;
  120.     }
  121. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement