HomeController.cs
Dosyayı İndir
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace SampleJQuery.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application.";
return View();
}
public ActionResult About()
{
ViewBag.Message = "Your app description page.";
return View();
}
public ActionResult Contact()
{
ViewBag.Message = "Your contact page.";
return View();
}
public ActionResult JQueryTest() {
return View();
}
public ActionResult MyLoaded()
{
return View("DataView");
}
public string MyData()
{
return "<b>Bu bir veridir<b>";
}
[HttpPost]
public string PingData(string sampleName,int sampleValue)
{
return "Alınan veriler "+sampleName+" " +sampleValue;
}
public JsonResult RawJson()
{
List<Exam> examList = new List<Exam>();
examList.Add(new Exam(1, "YGS"));
examList.Add(new Exam(2, "LYS"));
examList.Add(new Exam(3, "ALES"));
return new JsonResult { Data = (examList), JsonRequestBehavior = JsonRequestBehavior.AllowGet };
}
}
public class Exam {
public Exam()
{
}
public Exam(int turKod, string sinavTuru)
{
this.TurKod = turKod;
this.SinavTuru = sinavTuru;
}
public int TurKod { get; set; }
public string SinavTuru { get; set; }
}
}
Dosyayı İndir