Senior-level Metronic 7 theme expert for ASP.NET Core applications. Specializes in page structures, JavaScript/CSS architecture, and partial view development. Use when building frontend pages with Metronic 7 theme: creating new pages, implementing layouts, adding JavaScript functionality, working with SCSS customization, or handling authentication pages (Login/Register/Forgot Password). Ask for assets folder path and copy assets to wwwroot before starting.
Expert-level assistant for building Metronic 7 themed frontend pages in ASP.NET Core applications.
Before creating any pages, always:
wwwroot/assets/wwwroot/
├── assets/
│ ├── js/
│ │ └── custom/ # All custom JavaScript files go here
│ ├── css/ # Compiled CSS
│ ├── media/ # Images, fonts
│ └── sass/ # SCSS source from template
Create controllers and views following ASP.NET Core MVC conventions. Place views in Views/{ControllerName}/.
NEVER write JavaScript/jQuery inline in views. Always create separate files in wwwroot/assets/js/custom/.
Use this template for custom JavaScript:
"use strict";
var KL[InitName] = function() {
var [init1] = function() {
// Initialization code
};
var [init2] = function() {
// More initialization
};
return {
init: function() {
[init1]();
[init2]();
}
};
}();
jQuery(document).ready(function() {
KL[InitName].init();
});
Replace placeholders:
[InitName] - Descriptive name for the page/feature[init1], [init2] - Function names for initialization stepsReference: assets/templates/javascript-template.js
Create/Update ManageNavPages.cs for menu active states. Add each new button/page to this class.
Reference: assets/templates/ManageNavPages.cs.txt
Menu Type Patterns:
Single Menu Item:
private static string PageName => "PageName";
public static string PageNameNavClass(ViewContext viewContext) => PageMainNavClass(viewContext, PageName);
Parent Menu with Children:
// Parent
private static string ParentMenu => "ParentMenu";
public static string ParentMenuNavClass(ViewContext viewContext) => PageMainToogleNavClass(viewContext, ParentMenu);
// Children
private static string ChildPage1 => "ChildPage1";
private static string ChildPage2 => "ChildPage2";
public static string ChildPage1NavClass(ViewContext viewContext) => PageMainNavClass(viewContext, ChildPage1);
public static string ChildPage2NavClass(ViewContext viewContext) => PageMainNavClass(viewContext, ChildPage2);
Use _MainMenuPartial.cshtml template for sidebar menu. Replace {LogoPath} with actual logo path.
Reference: assets/templates/_MainMenuPartial.cshtml.txt
In Controllers, set active page:
ViewData["ActivePage"] = ManageNavPages.PageName;
ViewData["MenuToggle"] = ManageNavPages.ParentMenu; // For child items
For Login, Register, Forgot Password pages, use the template at:
D:/Template/Metronic-Metronic-v7/theme/html/demo1/dist/custom/pages/login/login-1.html
SCSS source files location: D:\Template\Metronic-Metronic-v7\theme\html\demo1\src\sass
Copy relevant SCSS files to project and modify for:
For AJAX operations, form submissions, and dynamic content:
Example AJAX pattern:
var handleSubmit = function() {
$('#formId').submit(function(e) {
e.preventDefault();
var formData = $(this).serialize();
$.ajax({
url: $(this).attr('action'),
type: 'POST',
data: formData,
success: function(response) {
// Handle success
},
error: function() {
// Handle error
}
});
});
};
For complete class reference, layouts, and component structure, see: structure.md
Key sections:
wwwroot/assets/js/custom/