vendredi 15 janvier 2016

Logoff Action Not Being Hit

Salaamun Alekum

I Have A MVC Action Of LogOff Which Is Not Being Hit By Form Using JavaScript My View Page Do Get Refresh On Form Submit But The Action Is Not Being Hit ( It Tried To Check Via Placing A Break Point For Debugging Inside LogOff() Action

This Is Portion Of Partial View (Full Partial View Can Be Found In Previous Edit Of This Post

    using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm", @class = "navbar-right navbarText" }))
    {
    @Html.AntiForgeryToken()

    <ul class="nav navbar-nav navbar-right">
        <li>
            @Html.ActionLink("Hello " + User.Identity.GetUserName() + "!", "Index", "Manage", routeValues: null, htmlAttributes: new { title = "Manage" })
        </li>
        <li><a href="javascript:document.getElementById('logoutForm').submit()">Log off</a></li>
    </ul>
    }

This Is My LogOff Action

        [HttpPost]
        [ValidateAntiForgeryToken]
        public ActionResult LogOff()
        {
            Session["LoggedInPersonId"] = null;
            //AuthenticationManager.SignOut(DefaultAuthenticationTypes.ApplicationCookie);
            return RedirectToAction("Index", "Home");
        }

I Need Guidance On This

Thank You

Aucun commentaire:

Enregistrer un commentaire