Update the Login Control

Total Post:8

Points:56
 2271  View(s)
Ratings:
Rate this:
How to update the Login control to display Login user details once logged in successfully.i.e. once Login into the Login form Login control should be changed as Logoff control and diplay the Login username details
  1. Post:65

    Points:455
    Re: Update the Login Control

    Hi,

    You can create user control to change the login to logoff.
    For eg.

    <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
    <%
        if (Request.IsAuthenticated) {
    %>
            Welcome <b><%: Page.User.Identity.Name %></b>!
            [ <%: Html.ActionLink("Log Off", "LogOff", "Account") %> ]
    <%
        }
        else {
    %>
            [ <%: Html.ActionLink("Log On", "LogOn", "Account") %> ]
    <%
        }
    %>

    You can also refer demo mvc application provided default in visual studio.

      Modified On Mar-29-2018 04:45:07 AM

Answer

Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.