Update 20210528 - mit LoginPopup
This commit is contained in:
34
App/ViewComponents/MenuItemsViewComponent.cs
Normal file
34
App/ViewComponents/MenuItemsViewComponent.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
//using App.Models;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using BWPMModels;
|
||||
using App.Models;
|
||||
|
||||
namespace APP.ViewComponents
|
||||
{
|
||||
public class MenuItemsViewComponent : ViewComponent
|
||||
{
|
||||
List<Object> menuItems = new List<Object>();
|
||||
//List<AppMenuItem> menuItems = new List<AppMenuItem>();
|
||||
public MenuItemsViewComponent()
|
||||
{
|
||||
//HttpContext.Session.SetString("usertype","1");
|
||||
//string usertype = HttpContext.Session.GetString("usertype");
|
||||
menuItems = AppMenuItem.MenuItems(APP.Models.SessionClass.UserType);
|
||||
ViewBag.menuitems = menuItems;
|
||||
var model = menuItems;
|
||||
}
|
||||
|
||||
public async Task<IViewComponentResult> InvokeAsync()
|
||||
{
|
||||
var model = menuItems;
|
||||
ViewBag.menuitems = menuItems;
|
||||
return await Task.FromResult((IViewComponentResult)View("MenuItems", model));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user