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

namespace MsAjax.Controllers
{
    public class ListaController : Controller
    {
        //
        // GET: /Lista/
        static List<string> listaElementow = new List<string>();
        public ActionResult Index()
        {
            return View(); //zwraca domyslny widok
        }

        public ActionResult DodajElementDoListy(FormCollection form)
        {
            if (form.Count > 0)
                listaElementow.Add(form[0].ToString() + " " + DateTime.Now.ToLongTimeString());// dodanie zawartosci form[0] (textboxa) do Listy typu string
            return View("Lista", listaElementow); //zwarca wodok PartalView z pliku Lista.cshtml

         }
    }
}
