PassportIdentity.LogoTag2
PassportIdentity.LogoTag2
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 takes advantage of the .NET Passport authentication capabilities that are built into Microsoft® Windows® XP. If you use this method to generate the Sign In button on a Web page, users who are using Microsoft® Internet Explorer 6 on Windows XP will enter their credentials into the .NET Passport sign-in user interface (UI) that is integrated into the operating system. As a result, any customized cobranding you supply will not be displayed. If you want to ensure that all users sign in using the cobranding-enabled Web UI, use the LogoTag method. For more information, see PassportIdentity.LogoTag.
Syntax
public string LogoTag2()
Return values
An HTML fragment containing an image tag for a .NET Passport link.
Example
In the following C# example, the LogoTag2() 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.LogoTag2()); %> </HTML>
Replacing the line (oMgr.LogoTag2()) with ("<DIV STYLE = 'position:absolute;right:50px'>" + oMgr.LogoTag2() + "</DIV>") will position the image on the upper-right corner of the page.
Remarks
The LogoTag2 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, LogoTag2 does not have an oExtraParams parameter to override the default Cobrand Instruction Text specified during site registration.
See Also
Passport PassportIdentity Object | PassportIdentity.LogoTag2(string,int,bool,string,int,bool,string,int,bool)