This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Action Filter | |
[OutputCache(Duration = 10)] | |
public string CurrentTime() | |
{ | |
return DateTime.Now.ToString("T"); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using System.Web.Mvc; | |
namespace FiltersDemo.Controllers | |
{ | |
public class HomeController : Controller | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using System.Web.Mvc; | |
namespace FiltersDemo.Controllers | |
{ | |
public class HomeController : Controller | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using System.Web.Mvc; | |
namespace FiltersDemo.Controllers | |
{ | |
public class HomeController : Controller | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public ActionResult Student(String Name) | |
{ | |
var input = Server.HtmlEncode(Name); | |
return Content(input); | |
} | |
public ActionResult Student() | |
{ | |
var input = "This is another Studetn Action Method"; | |
return Content(input); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public ActionResult Student(String Name) | |
{ | |
var input = Server.HtmlEncode(Name); | |
return Content(input); | |
} | |
[HttpGet] | |
public ActionResult Student() | |
{ | |
var input = "This is another Studetn Action Method"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[HttpPost] | |
public ActionResult PostAction() | |
{ | |
return View("Index"); | |
} | |
[HttpPut] | |
public ActionResult PutAction() | |
{ | |
return View("Index"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[AcceptVerbs(HttpVerbs.Post | HttpVerbs.Get)] | |
public ActionResult GetAndPostStudentAction() | |
{ | |
return View(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Data.Entity; | |
using System.Linq; | |
using System.Web; | |
namespace DataBaseDemo.Models | |
{ | |
public class Student | |
{ |
OlderNewer