Query Strings on the Style Sheet URL
Query Strings on the Style Sheet URL
In order to facilitate cobranding of styles for context-sensitive cases and to make it simpler to localize style sheets, the Microsoft® .NET Passport cobranding mechanism appends two query string parameters onto the URL used to call your .css file when used for cobranding. The first part of the query string is the entire cobranding argument string as used for the cobranding template. This string is passed as the coBrandArgs parameter of LoginUser, LogoTag2, and AuthURL2 methods for single sign-in (SSI). The second part of the query string is the locale ID (LCID) passed as the optional lang_id parameter to these methods.
Sending cb Parameter (CobrandArgs) and LCID to Single Sign-In (Login Server)
The following is an example of calling cobranding through a Passport Manager method call.
Example
The following is an Active Server Pages (ASP) example of how a page can handle the incoming query string and return differing style sheets based on the query string parameters added when the .css file is called.
<% Response.Contenttype = "text/css" If Request.QueryString("zone") <> "" Then redcb() ElseIf Request.QueryString("lid") = "1041" Then japanesecb() Else bluecb() End If %> <%Sub redcb%> .PassportStyleElement1 {font-family:times,bookman; color:#f00000} .PassportStyleElement2 {bgcolor:#f00000} .PassportStyleElement3 {background-color:#f00000} <%End Sub Sub Bluecb%> .PassportStyleElement1 {font-family:times,bookman; color:#0000d0} .PassportStyleElement2 {bgcolor:#0000d0} .PassportStyleElement3 {background-color:#0000d0} <%End Sub Sub japanesecb%> /*do not give font face use charset default*/ .PassportStyleElement1 {color:#00d000} .PassportStyleElement2 {bgcolor:#00d000} .PassportStyleElement3 {background-color:#00d000} <%End Sub%>
In the preceding example, the PassportStyleElement tags are placeholders. They do not actually exist in the .NET Passport style sheet. To obtain the supported style elements, download the latest version of the .NET Passport style sheet here.
The LCID as given to Passport Manager methods also affects the language in which the resulting Web page user interface (UI) is displayed, as long as that language or locale is supported. For information about supported languages, see the .NET Passport Web site .
On servers that support flexible-layout cobranding (the Login, Registration, and Member Services servers), the PP_SERVICE parameter is added to the query string sent in template and style sheet requests. This PP_SERVICE parameter could also be used to differentiate the style that is used on sign-in as opposed to Registration pages, but this is not specifically illustrated in the example. If you choose to use flexible-layout cobranding, only styles that are used by the actual user interface (UI) portion served by .NET Passport would require that you serve a specific style for them. Otherwise, you would have full control over how the remainder of the elements used on the pages were referenced in terms of style, block name, and so on.
See Also
.NET Passport Cobranding Overview | .NET Passport Cobranding Style Sheets | Localization and .NET Passport Services | Flexible-Layout Cobranding Overview