Problems With Global.asax in VB

D

Daniel Friend

I am trying to add the following as my global.asax file in vb. I am getting
errors like crazy. They are as follows

* Error 1 There can be only one 'application' directive.
* Error 4 Validation (ASP.Net): This attribute name must be followed by an
equal (=) sign and a value. If the value is in quotation marks, the
quotation marks must match.
* Error 5 Validation (ASP.Net): Attribute 'Implements' is not a valid
attribute of element 'Application'.
* Error 6 Validation (ASP.Net): Attribute 'Interface' is not a valid
attribute of element 'Application'.

Please help me get this working

Thanks,

Dan



GLOBAL.ASAX
<%@ Application %>
<%@ Implements
Interface="CuteSoft.Chat.IHttpApplicationConnectionStringProvider" %>
<%@ Implements Interface="CuteSoft.Chat.IHttpApplicationUserAdapter" %>
<%@ Implements Interface="CuteSoft.Chat.IHttpApplicationDataProvider" %>
<%@ Implements Interface="CuteSoft.Chat.IHttpApplicationSupportLogin" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="CuteSoft.Chat" %>

<Script runat=server Language=VB>

#Region " IHttpApplicationConnectionStringProvider Members "
'Step 1: Let CuteChat know your databse connection string
Public Function GetConnectionString(ByVal user As
CuteSoft.Chat.UserIdentity) As String Implements
CuteSoft.Chat.IHttpApplicationConnectionStringProvider.GetConnectionString
'Return
System.Configuration.ConfigurationSettings.AppSettings("ConnectionString")
Return "NOT IMPLEMENTED"
End Function

#End Region
#Region " IHttpApplicationUserAdapter Members "
'Step 2: Let CuteChat know who has logged in the website
Public Function GetUserUniqueName() As String Implements
CuteSoft.Chat.IHttpApplicationUserAdapter.GetUserUniqueName
'If Not Context.Request.IsAuthenticated Then
' Return Nothing
'End If

''email
'Return Context.User.Identity.Name
Return "NOT IMPLEMENTED"
End Function

Public Function GetUserIdentity() As CuteSoft.Chat.UserIdentity
Implements CuteSoft.Chat.IHttpApplicationUserAdapter.GetUserIdentity
Dim un As String = GetUserUniqueName()
If un Is Nothing Then
Return CuteSoft.Chat.UserIdentity.CreateNull()
End If

Return New CuteSoft.Chat.UserIdentity(un, Nothing,
Context.Request.UserHostAddress)
End Function

#End Region
</Script>
 
W

Walter Wang [MSFT]

Hi Dan,

Thank you for posting.

From your post, my understanding on this issue is: you're trying to
implement some interfaces in the application class. If I'm off base, please
feel free to let me know.

You can place the application class in a separate file and put it in the
app_code folder, sample code:

Imports System.Web

Public Class YourGlobalClass
Inherits HttpApplication
Implements IFoo

End Class


And edit Global.asax as follows:

<%@ Application Language="VB" Inherits="YourGlobalClass" %>



Please let me know if you have any other concerns, or need anything else.

Regards,

Walter Wang
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top