Working with the Authenticated User

Posted on 5/18/2012 | Printable Version | Comments (0)

When a user is logged in, you can access details about the user using ASP.NET code. Here are a few simple examples to demonstrate that. 

Sample ASCX File:
<%@ Control Language="c#" Inherits="Waypoint.Core.WPControl" %>
<% 
//IF AUTHENTICATED, THE USER OBJECT WILL NOT BE NULL
if(((Waypoint.Core.WPPageLite)Page).AuthenticatedUser!=null){
%>

Hello <%= ((Waypoint.Core.WPPageLite)Page).AuthenticatedUser.First_Name %>.

<% } %>


Comments

Be the first to comment below.

Post Comment