skip to Main Content

ASP.NET core MVC how to use dropdown list

Im trying to make dropdown list in my razor view using Viewbag but its not working, Im missing something I guess public IEnumerable<SelectListItem> GetAllEmployeeForPayroll() { return GetAll().Select(emp => new SelectListItem() { Text = emp.FullName, Value = emp.Id.ToString() }); } ViewBag.employees…

VIEW QUESTION

Asp.net Core Razor RenderPage doesn't work in _layout.cshtml

I'm reading this tutorial(https://learn.microsoft.com/en-us/aspnet/web-pages/overview/ui-layouts-and-themes/3-creating-a-consistent-look) and trying to add header and footer into layout file. But Visual Studio is giving an error when I build the project. <!DOCTYPE html> <html> <head> <title>Structured Content </title> <link href="~/Styles/Site.css" rel="stylesheet" type="text/css" /> </head> <body>…

VIEW QUESTION
Back To Top
Search