I\'m trying to load my partial view with some data from database, but I\'m getting following issue when I run the application:
Child actions are not allo
At the end I decided to skip my PartialViewResult method from a controller and do it on another way, because I've allready lost 2 days trying to find an answer and it wasn't there, but something else seems to be working, and it was this:
{@Html.RenderPartial("~/Views/Emails/_UnReadEmails.cshtml",EmailController.GetUnreadEmailsByUserId(User.Id))}
What I did there was next, I called directly GetUnreadEmaisByUserId method from my BussinesLogic part, and everything worked like charm.
And what we might do here to make this solution better is next:
In case we dont have a "main model" we could store that in a ViewBag, calling this from a MessageController/Email controller method
ViewBag.lstUnreadEmails = EmailController.GetUnreadEmailsByUserId(User.Id);
And in the View use this
{@Html.RenderPartial("~/Views/Emails/_UnReadEmails.cshtml",ViewBag.lstUnreadEmails}