Issue Why do we have ViewBag and ViewData if they are doing the same thing in ASP.NET Core MVC? Is there anything which ViewBag can do and ViewData can’t – or vice versa? Any specific scenario when should I prefer
Continue readingTag: viewbag
[SOLVED] Access data from Viewbag Dropdown
Issue I am getting the value from dropdown to controller but when it goes back to View it returns Null SCREENSHOT OF VIEW:- SCREENSHOT OF CONTROLLER:- public ActionResult Index(int departmentID) { ViewBag.dropdowndetail = null; var strDDLValue = departmentID; if (strDDLValue
Continue reading[SOLVED] DropDownList From Objects MVC
Issue Ok so I want make a DropDownList from my object list here is my getting object method public List<Category> GetCategoriesList() { BaseShopEntities context = new BaseShopEntities(); List<Category> uniqCategories = (from c in context.Category select c).Distinct().ToList<Category>(); return uniqCategories; } I
Continue reading[SOLVED] How to return model to view that requires ViewData in .net core MVC?
Issue I have .net core mvc application, which has two action methods inside post controller. [HttpGet] public async Task<IActionResult> Create() { var hostAppGetQuery = new Application.Handlers.HostApps.Queries.List.Query(); var platformGetQuery = new Application.Handlers.Platforms.Queries.List.Query(); var hostApps = await _mediator.Send(hostAppGetQuery); var platforms = await
Continue reading[SOLVED] Make Kendo ASP.NET MVC inCell Editable based on Viewbag condition
Issue Is it possible to make a Kendo MVC grid .Editable() based on a function that allows editing ONLY if you have a certain Viewbag? I have a viewbag that is Viewbag.DisplayButton. That viewbag is only ‘true’ if you have
Continue reading[SOLVED] Count and Sum functions with help of ViewBag
Issue I have a question how to solve my problem. There is a table with items. Each item has a status "open" or "closed". For instance, 9 items with "closed" status and 14 ones with "open". I need to find
Continue reading[SOLVED] Missing ViewBag data in jQuery add row
Issue Heres My Model and ViewModel. I have multiple Models, just showing parts of them for now. public class Order { [Key] public int Id { get; set; } public int TotalItems { get; set; } public DateTime DeliveryDate {
Continue reading