You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.3 KiB

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using APP.Models;
using Microsoft.AspNetCore.Http;
namespace APP.Controllers
{
public class HomeController : Controller
{
private readonly ILogger<HomeController> _logger;
public HomeController(ILogger<HomeController> logger)
{
_logger = logger;
}
public IActionResult Index()
{
HttpContext.Session.SetString("SessionVariable1", "Testing123");
return View();
}
public IActionResult Privacy()
{
ViewBag.Message = HttpContext.Session.GetString("SessionVariable1");
return View();
}
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
}
public IActionResult Login()
{
HttpContext.Session.SetString("ShowLogin", "True");
ViewBag.showlogin = "True";
return View();
}
}
}