Tuesday, November 19, 2013

Co

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Data;
using System.Xml.XPath;
using System.Xml.Linq;
using System.Xml;
using System.IO;
using Exam.Models;

namespace Exam.Controllers
{
    public class ExamController : Controller
    {
        //
        // GET: /Exam/
        private ExamModel eModel = new ExamModel(@"C:\Users\Leagues.xml");
        public ActionResult ExamHome()
        {
            string str = eModel.ReadXML("All");
            var table = MvcHtmlString.Create(str);
            ViewBag.Table = table;
            return View();
        }

        [HttpPost]
        public JsonResult GetLeague(string league)
        {
            return Json(eModel.ReadXML(league));
        }

    }
}

No comments:

Post a Comment