Imports DevExpress.Web

Public Class Pre
    Inherits System.Web.UI.MasterPage

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then

            If HttpContext.Current.User.Identity.IsAuthenticated AndAlso IsNumeric(Page.User.Identity.Name) Then
                'Si hay usuario autenticado pondra el Login visible en el control LoginView
                Dim oUsuario As New UsuariosBusinessObject(CInt(Page.User.Identity.Name))

                If Session("login") = Nothing Then Session("login") = oUsuario.Entity.login
                If Session("idIns") = Nothing Then Session("idIns") = oUsuario.Entity.idInstitucion

                'Dim l As ASPxButton = MultiView1.FindControl("btnLogin")
                'l.Text = Session("login")
                Dim label As DevExpress.Web.MenuItem = LoginMenu.Items.FindByName("nombre")
                label.Text = Session("login")
            End If
        End If
    End Sub

    Private Sub MultiView1_Init(sender As Object, e As EventArgs) Handles MultiView1.Init
        If HttpContext.Current.User.Identity.IsAuthenticated() Then
            MultiView1.SetActiveView(viewLoggedIn)
        Else
            MultiView1.SetActiveView(viewAnonymous)
        End If
    End Sub
End Class