đ IrbyImaging/Views/Home/SignIn.cshtml Documentation
Table of Contents
- Overview & Purpose
- File Location & Structure
- Dependencies & Technologies
- Layout & Regions
- Form Structure & Controls
- Navigation & Routing
- Thirdâparty Integrations & Scripts
- Error Handling & Validation
- Sequence Diagram
- Usage Examples
- 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
Indexaction or to Microsoft IdentityâsSignInendpoint.
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
- Wrapper
<div class="account-pages my-5 pt-sm-5">â centers content vertically. - Card Container
Bootstrapâs card with a soft primary header and overflow hidden. - Header Section
- Left: Welcome message.
- Right: Profile illustration.
- Auth Logo
Light & dark theme toggles for the company logo. - 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-arealink pointing to Identityâs SignIn.d-gridclass 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:
- Serverâside: Apply
[Required]attributes in a ViewModel. - 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 đ
- Access the page
Navigate tohttps://yourapp/Home/SignIn. - Customizing the Title
ChangeViewData["Title"]to"Sign In"for clarity. - Adding Validation
- Create a
SignInViewModel - Bind it to the view (
@model SignInViewModel) - Leverage
asp-fortagâhelpers on<input />fields.
- Create a
- Switch Logo
Replace~/assets/images/logo.svgwith 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