Questions tagged [viewbag]

ViewBag is a dynamic type object in the ASP.NET MVC framework that can be used to send miscellaneous data from the controller to the view.

ViewBag is a member of the ControllerBase class in the ASP.NET MVC framework. It's a dynamic type object that can be used to send miscellaneous data from the controller to the view. Its type is dynamic.

718 questions
-2
votes
2 answers

how to get one item of the list in a foreach ViewBag mvc 5

I want to get all the student have the ContractStatus == "Pending" in foreach and make a link to Edit the student
@{ foreach (var studentCohort in ViewBag.CohortSubscriptionId) {
-2
votes
2 answers

How To Use ViewBag Data In jQuery

Here I have ViewBag in a controller which contains text i.e ViewBag.Msg = "No Sprint". And I am trying to use ViewBag.Msg in Jquery to display modal. Now, the problem is that the script is script never gets executed. Below is my jQuery.