Common Security PassThrough
Common_SecurityPassThrough_VBNet\SecurityPassThrough_Forms_VBNet\Login.aspx.vb
' Copyright 2010 ESRI
' 
' All rights reserved under the copyright laws of the United States
' and applicable international laws, treaties, and conventions.
' 
' You may freely redistribute and use this sample code, with or
' without modification, provided you include the original copyright
' notice and use restrictions.
' 
' See the use restrictions.
' 

Imports Microsoft.VisualBasic
Imports System
Partial Public Class Login
  Inherits System.Web.UI.Page
  ' This method is called immediately after the user is logged in by the Login 
  ' control.
  Protected Sub Login1_LoggedIn(ByVal sender As Object, ByVal e As System.EventArgs)
    ' Capture the username and password in an ADF Identity object
    Dim adfUserIdentity As New ESRI.ArcGIS.ADF.Identity()
    adfUserIdentity.UserName = Login1.UserName
    adfUserIdentity.Password = Login1.Password

    ' Save the identity in the Session. This will be used when Default.aspx 
    ' loads to set the identity of the map resource.
    Session("userIdentity") = adfUserIdentity.ToString()
  End Sub
End Class