PassportIdentity.LogoTag

PassportIdentity.LogoTag

Returns an HTML fragment containing an image tag for a Microsoft .NET Passport link. The image displays either the Sign In or Sign Out IMG source, as appropriate.

Important  This method does not take advantage of the .NET Passport authentication capabilities that are built into Microsoft® Windows® XP. The LogoTag2 method does use this functionality. For more information, see PassportIdentity.LogoTag2.

Syntax

public string LogoTag()

Return values

An HTML fragment containing an image tag for a .NET Passport link.

Example

In the following C# example, the LogoTag() method is used to sign the user in to the .NET Passport site. The return URLs are specified in the application.

<%@ Page Language="C#"%>
<%@ Import Namespace = "System.Web.Security" %>
<HTML>
<HEAD><TITLE>Mysample - Exercise - CS</TITLE></HEAD>
<Script language="C#" runat="server">
 PassportIdentity oMgr;

 protected void Page_Load(Object src, EventArgs e) {
   oMgr = (PassportIdentity)Context.User.Identity;
 }
</Script>
<%
Response.Write(oMgr.LogoTag());
%>
</HTML>

Replacing the line (oMgr.LogoTag()) with ("<DIV STYLE = 'position:absolute;right:50px'>" + oMgr.LogoTag() + "</DIV>") will position the image on the upper-right corner of the page.

Remarks

The LogoTag image is the sign-in or sign-out image that contains a link to the .NET Passport sign-in or sign-out URL. If no valid Ticket cookie is detected, the link image displays Sign In; if a valid ticket cookie is detected, the link image displays Sign Out.

This overloaded method uses the return URL, time window, force login, cobranding arguments, language ID, and secure level defaults specified in the Passport Manager Administration utility.

Unlike the LoginUser method of the PassportIdentity object, LogoTag does not have an oExtraParams parameter to override the default Cobrand Instruction Text specified during site registration.

See Also

Passport PassportIdentity Object | PassportIdentity.LogoTag(string,int,bool,string,int,bool,string,int,bool)