using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using TabStripDataSource.Models;

namespace TabStripDataSource.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            ViewBag.Message = "Welcome to ASP.NET MVC!";

            var data = new List<TabStripModel>();

            data.Add(new TabStripModel() { ItemID = 1, ItemText = "Item1" });
            data.Add(new TabStripModel() { ItemID = 2, ItemText = "Item2" });
            data.Add(new TabStripModel() { ItemID = 3, ItemText = "Item3" });

            return View(data);
        }

        public ActionResult GetTabContent(int id) {
            if (id == 1) {
                return PartialView("Tab1");
            }else if (id == 2)
            {
                return PartialView("Tab2");
            }
            return PartialView("Tab3");
        }
    }
}
