Ram Pradeep

Ram Pradeep

  • NA
  • 59
  • 10.7k

Display data in mvc

Nov 4 2015 11:50 PM
 I have a mvc application in vs 2010.in that  i have a home controller with one method Index().It is going to return a list of countries.That countries list i want to display through view. How to do that in vs 2010.please tell me how to add view for this and what we need to write code for displaying it to end user.
 
 
Here is my controller action.
 
public ActionResult Index()
{
ViewData["countries"]= new List<string>()
{
"INDIA",
"PAKISTHAN",
"AUSTRALIA",
"SOUTH AFRICA"
};
return View();
 

Answers (14)