ViewData["Message"] = "Hello from ViewData!";
ViewBag.Message = "Hello from ViewBag!";
TempData["Message"] = "Hello from TempData!";
HttpContext.Session.SetString("Username", "JohnDoe");
Response.Cookies.Append("Username", "MohanKumar", new CookieOptions { Expires = DateTime.Now.AddHours(1) });
public IActionResult MyAction()
{
string paramValue = HttpContext.Request.Query["paramName"];
// ...
}