Is it possible to show database content on _layout.cshtml?
I have menu and roleMenu tables, and I want show different a menu based on database records.
CREATE TABLE IF NOT EXISTS `menu` (
`Id` INT NOT NULL AUTO_INCREMENT,
`Name` VARCHAR(50) NOT NULL,
`IconUrl` VARCHAR(200) NOT NULL,
`ActionUrl` VARCHAR(200) NOT NULL,
`ParentMenuId` INT NULL DEFAULT NULL,
`Hide` boolean not null DEFAULT False,
PRIMARY KEY (`Id`),
CONSTRAINT `FK_menu_menu` FOREIGN KEY (`ParentMenuId`) REFERENCES `menu` (`Id`) ON DELETE CASCADE);
How can I do this?
Checkout this article by Sumit Maitra: http://www.dotnetcurry.com/ShowArticle.aspx?ID=811
I think, it will help you in achieving what you are looking for