Sponsored By
DataConverter
Advertise with Us
Advertisement
Advertise with Us
Follow Us
Follow _MindStick_ on Twitter View MindStick Software's LinkedIn profile View MindStick Software's Facebook profile
Mindstick
Article Article  Forum Forum  Blog Blog  Quiz Quiz  Beginner Beginner  Careers Careers  Contact Contact  Login Login  
Home | Product | Services | About Us | Interview | DeveloperSection | Submit an Article | Submit Blog
Report Abuse Form
Reason:    
   

Home >> .Net >> ASP.NET MVC >> Update the Login Control
Author Post

ravi kumar


Total Post: 9
Member Since: 11/1/2011
Points: 47
Update the Login Control
Posted On: 11/1/2011 11:50:03 PM
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
Author Post

Rohit Kesharwani


Total Post: 54
Member Since: 8/8/2011
Points: 385
Re: Update the Login Control
Posted On: 11/2/2011 12:42:01 AM
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.
Report Abuse Form
Reason:    
 
Total Online Users: 2687
Advertisement
MindStick DataConverter
Advertise with Us
  
Copyright © 2009 - 2013MindStick. All Rights Reserved.