📄 IrbyImaging/Views/Home/SignIn.cshtml Documentation


Table of Contents

  1. Overview & Purpose
  2. File Location & Structure
  3. Dependencies & Technologies
  4. Layout & Regions
  5. Form Structure & Controls
  6. Navigation & Routing
  7. Third‑party Integrations & Scripts
  8. Error Handling & Validation
  9. Sequence Diagram
  10. Usage Examples
  11. Conclusion

1. Overview & Purpose 🎯

The SignIn.cshtml Razor view provides a responsive sign‑in page for users returning to the IrbyImaging application.
It leverages Bootstrap styling, custom layouts, and optional Microsoft Identity integration to deliver a polished authentication UI.

Key Objectives:

  • Display a friendly “Welcome Back!” message with a branded logo.
  • Collect username and password inputs.
  • Offer Remember me functionality.
  • Facilitate submission to the Index action or to Microsoft Identity’s SignIn endpoint.

2. File Location & Structure 📁

Property Value
File Name SignIn.cshtml
Project Path /IrbyImaging/Views/Home/SignIn.cshtml
View Engine ASP.NET Core Razor
Layout ~/Views/Shared/_Layout.cshtml

Directory Tree Preview:

IrbyImaging
└── Views
    └── Home
        └── SignIn.cshtml

3. Dependencies & Technologies 🛠️

Technology/Library Purpose
ASP.NET Core Razor Server‑side view rendering
Bootstrap 5 Responsive grid & form styling
MetisMenu Side‑menu interactions (loaded but unused here)
SimpleBar Custom scrollbars
Waves Ripple effects on buttons
Microsoft Identity Optional external sign‑in endpoint
MVC URL Helpers @Url.Action, asp-area, asp-controller

4. Layout & Regions 📐

@{
    ViewData["Title"] = "Create";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
  • Layout: Inherits the shared master page, injecting this view into the body section.
  • ViewData["Title"]: Sets the browser tab’s title to “Create” (adjustable to “Sign In” for clarity).

Page Structure

  1. Wrapper
    <div class="account-pages my-5 pt-sm-5"> – centers content vertically.
  2. Card Container
    Bootstrap’s card with a soft primary header and overflow hidden.
  3. Header Section
    • Left: Welcome message.
    • Right: Profile illustration.
  4. Auth Logo
    Light & dark theme toggles for the company logo.
  5. Form Panel
    Username, password controls, remember checkbox, and submit button.

5. Form Structure & Controls 🖊️

<form class="form-horizontal" action="@Url.Action("Index","Index")">
  <!-- Username Field -->
  <div class="mb-3">
    <label for="username" class="form-label">Username</label>
    <input type="text" class="form-control" id="username" placeholder="Enter username">
  </div>

  <!-- Password Field w/ Toggle -->
  <div class="mb-3">
    <label class="form-label">Password</label>
    <div class="input-group auth-pass-inputgroup">
      <input type="password" class="form-control" placeholder="Enter password" aria-label="Password" aria-describedby="password-addon">
      <button class="btn btn-light" type="button" id="password-addon">
        <i class="mdi mdi-eye-outline"></i>
      </button>
    </div>
  </div>

  <!-- Remember Me -->
  <div class="form-check">
    <input class="form-check-input" type="checkbox" id="remember-check">
    <label class="form-check-label" for="remember-check"> Remember me </label>
  </div>

  <!-- Actions -->
  <div class="mt-3 d-grid">
    <button class="btn btn-primary waves-effect waves-light" type="submit">Log In</button>
    <a class="dropdown-item text-danger" asp-area="MicrosoftIdentity" asp-controller="Account" asp-action="SignIn">
      <i class="bx bx-power-off font-size-16 align-middle me-1 text-danger"></i>
      <span key="t-logout">Sign In</span>
    </a>
  </div>
</form>

Highlights:

  • Password Toggle button with an eye icon (mdi-eye-outline).
  • asp-area link pointing to Identity’s SignIn.
  • d-grid class to stretch buttons full‑width.

6. Navigation & Routing 🔀

Link/Button Route Description
Logo Light/Dark @Url.Action("Index", "Index") Redirect to home page
Form Submit @Url.Action("Index", "Index") Post credentials to HomeController.Index
Identity SignIn /MicrosoftIdentity/Account/SignIn External AAD/Microsoft Identity login

7. Third‑party Integrations & Scripts 🔌

At the bottom of the view, several JS libraries are loaded:

<script src="~/libs/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="~/libs/metismenu/metisMenu.min.js"></script>
<script src="~/libs/simplebar/simplebar.min.js"></script>
<script src="~/libs/node-waves/waves.min.js"></script>
  • bootstrap.bundle: Core JS for dropdowns, modals, tooltips.
  • metisMenu: Menu accordion (optional).
  • simplebar: Custom scrollbar styling.
  • waves: Click ripple effect.

8. Error Handling & Validation ⚠️

This view does not include built‑in model validation summaries or client‑side validation scripts.
To integrate validation:

  1. Server‑side: Apply [Required] attributes in a ViewModel.
  2. Client‑side: Include and configure jquery.validate & jquery.validate.unobtrusive.
@model SignInViewModel

<form asp-action="Index" method="post">
  <div asp-validation-summary="All" class="text-danger"></div>
  <!-- ... -->
</form>

@section Scripts {
  <script src="~/lib/jquery-validate/jquery.validate.min.js"></script>
  <script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script>
}

9. Sequence Diagram 🕹️

sequenceDiagram
    participant U as User
    participant B as Browser
    participant S as Server

    U->>B: Click "Sign In" link
    B->>S: GET /Home/SignIn
    S-->>B: HTML(SignIn.cshtml)
    B-->U: Renders SignIn form

    U->>B: Fill form, click Log In
    B->>S: POST /Home/Index
    alt Valid Credentials
      S-->>B: Redirect to Dashboard
    else Invalid
      S-->>B: Return SignIn with error
    end

10. Usage Examples 📝

  1. Access the page
    Navigate to https://yourapp/Home/SignIn.
  2. Customizing the Title
    Change ViewData["Title"] to "Sign In" for clarity.
  3. Adding Validation
    • Create a SignInViewModel
    • Bind it to the view (@model SignInViewModel)
    • Leverage asp-for tag‑helpers on <input /> fields.
  4. Switch Logo
    Replace ~/assets/images/logo.svg with your brand asset.

11. Conclusion ✅

The SignIn.cshtml view is a lightweight, Bootstrap‑based login UI that can be extended with custom validation, theming, and identity providers. Its modular structure—using a shared layout, URL helpers, and script includes—ensures consistency across the application and ease of maintenance.

Feel free to:

  • Add server‑side or client‑side validation
  • Tie into your chosen authentication pipeline
  • Customize styling or script bundles

🚀 Happy Coding! 🚀


End of Documentation