Amr Elshaer

Amr Elshaer

  • NA
  • 375
  • 19k

How To Make View Take More Parameter in Asp.net Mvc

Nov 17 2020 5:08 AM
If you Want To make your view Take more argument you can use Tuple instead of making an object
 Let`s say I have a view that takes IEnumerable of Student If I want to pass something with it to view I make an object 
that contain IEnumerable of student and string Message or using ViewBag or ViewData  so you can use Tuple
in view (IEnumerable<Student> students, string message) so it makes view code and view dependency.

Answers (3)