2021-02-19|閱讀時間 ‧ 約 2 分鐘

ASP.NET MVC 登入/登出 實例參考

    另記: 在controller內加入 [Authorize] 會強制先去登入。 ex:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.Mvc;
    namespace Test.Controllers
    {

    [Authorize]

    public class HomeController : Controller
    {
    public ActionResult Index()
    {
    return View();
    }
    public ActionResult About()
    {
    ViewBag.Message = "Your application description page.";
    return View();
    }
    }
    }
    分享至
    成為作者繼續創作的動力吧!
    從 Google News 追蹤更多 vocus 的最新精選內容從 Google News 追蹤更多 vocus 的最新精選內容

    發表回應

    成為會員 後即可發表留言