SideBar25
Overview
SideBar25 is a lightweight reusable UI helper used to
render a sidebar panel (drawer) and generate JavaScript click handlers
for opening the sidebar with dynamic content.
It is commonly used for showing timelines, details, logs, or
additional contextual information without navigating away
from the current page.
Key Features
- Reusable sidebar HTML via embedded resource
- Dynamic control ID replacement
- Dynamic title support
- Simple JavaScript-based open trigger
- Clean separation of UI and logic
Class Structure
SideBar25
| Method |
Description |
| GetHtml() |
Generates sidebar HTML markup |
| GetOnClick() |
Returns JavaScript onclick handler |
Method: GetHtml
HtmlString GetHtml(string controlId, string title = "")
| Parameter |
Type |
Description |
| controlId |
string |
Unique ID for the sidebar container |
| title |
string |
Sidebar header title (default: Shipment Timeline) |
Method: GetOnClick
string GetOnClick(string url)
| Parameter |
Type |
Description |
| url |
string |
URL used to load sidebar content |
Returned Value
showShipmentTimeline("url")
This value is typically assigned to an HTML element’s
onclick attribute.
Usage Example
Render Sidebar
@SideBar25.GetHtml("shipmentSidebar", "Shipment Timeline")
Trigger Sidebar Open
<a href="#"
onclick="@SideBar25.GetOnClick('/Shipment/Timeline/123')">
View Timeline
</a>