470,631 Members | 2,027 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,631 developers. It's quick & easy.

Error in Global file???

Hi,

Can someone please tell me why I get this error when I try to build my ASP.NET application???

Could not load type 'CPNNet.Global'.

Line 1: <%@ Application Codebehind="Global.asax.vb" Inherits="CPNiNet.Global" %>

Thanks for any help!

Here is the code which causes the error!

Imports System.Web
Imports System.Web.SessionState

Public Class Global
Inherits System.Web.HttpApplication

#Region " Component Designer Generated Code "

Public Sub New()
MyBase.New()

'This call is required by the Component Designer.
InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Required by the Component Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Component Designer
'It can be modified using the Component Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
components = New System.ComponentModel.Container()
End Sub

#End Region

Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the application is started
End Sub

Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the session is started
End Sub

Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
' Fires at the beginning of each request
End Sub

Sub Application_AuthenticateRequest(ByVal sender As Object, ByVal e As EventArgs)
If Request.IsAuthenticated Then
'Determine this user's roles
Dim reader As System.Data.SqlClient.SqlDataReader = _
Microsoft.ApplicationBlocks.Data.SqlHelper.Execute Reader("Data Source=server;" & _
"Initial Catalog=Database;" & _
"Integrated Security=SSPI" & _
CommandType.StoredProcedure, "rolesForUser", _
New System.Data.SqlClient.SqlParameter("@Username", User.Identity.Name))

' Create an array of role names
Dim roleList As New ArrayList
Do While reader.Read()
roleList.Add(reader("Name"))
Loop

'Convert the roleList ArrayList to a String array
Dim roleListArray As String() = roleList.ToArray(GetType(String))

'Add the roles to the User Principal
HttpContext.Current.User = _
New System.Security.Principal.GenericPrincipal(User.Id entity, roleListArray)
End If
End Sub

Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
' Fires when an error occurs
End Sub

Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the session ends
End Sub

Sub Application_End(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the application ends
End Sub

End Class

Nov 18 '05 #1
0 1096

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Wayno | last post: by
2 posts views Thread by John F Dutcher | last post: by
14 posts views Thread by Roland Hall | last post: by
8 posts views Thread by Brett Romero | last post: by
8 posts views Thread by jcrouse | last post: by
1 post views Thread by PaulieS | last post: by
7 posts views Thread by i | last post: by
11 posts views Thread by xenoix | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.