Torna al Thread

<%@ Application Language="VB" %> <script runat="server"> Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs) ' Codice eseguito all\'avvio dell\'applicazione End Sub Sub Application_End(ByVal sender As Object, ByVal e As EventArgs) ' Codice eseguito all\'arresto dell\'applicazione End Sub Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs) ' Codice eseguito in caso di errore non gestito End Sub Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs) ' Codice eseguito all\'avvio di una nuova sessione End Sub Sub Session_End(ByVal sender As Object, ByVal e As EventArgs) ' Codice eseguito al termine di una sessione. ' Nota: l\'evento Session_End viene generato solo quando la modalità sessionstate ' è impostata su InProc nel file Web.config. Se la modalità è impostata su StateServer ' o SQLServer, l\'evento non viene generato. End Sub Sub Application_AuthenticateRequest(ByVal sender As Object, ByVal e As EventArgs) If (Not (HttpContext.Current.User Is Nothing)) Then If HttpContext.Current.User.Identity.AuthenticationType = "Forms" Then Dim strUsername As String = HttpContext.Current.User.Identity.Name.ToString Dim strRole As String = HttpContext.Current.User.Identity.IsAuthenticated.ToString HttpContext.Current.User = New System.Security.Principal.GenericPrincipal(strUsername, New String() {strRole}) End If End If End Sub </script>
Copyright © dotNetHell.it 2002-2025
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5