473,387 Members | 1,742 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Problems With Global.asax in VB

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.IHttpApplicationConnectio nStringProvider" %>
<%@ Implements Interface="CuteSoft.Chat.IHttpApplicationUserAdapt er" %>
<%@ Implements Interface="CuteSoft.Chat.IHttpApplicationDataProvi der" %>
<%@ Implements Interface="CuteSoft.Chat.IHttpApplicationSupportLo gin" %>
<%@ 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.IHttpApplicationConnectionStringProv ider.GetConnectionString
'Return
System.Configuration.ConfigurationSettings.AppSett ings("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.GetUserU niqueName
'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.GetUserI dentity
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>
May 8 '06 #1
1 2865
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.

May 8 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Luther Hert | last post by:
While trying to work through textbook lessons for Vb.net Step by Step,Version 2003, Chapter 22, the first step is to create a new Web application Project,using the ASP.Net Application icon in the...
2
by: Craig G | last post by:
we have a project which is kept in SourceSafe but when "Get Latest Version" on a fresh development machine and try and run the project i get the following error Parser Error Description: An...
22
by: fd123456 | last post by:
Hi Tom ! Sorry about the messy quoting, Google is playing tricks on me at the moment. > Global.asax is where you normally have the Global Application > and Session variables and code to...
12
by: John M | last post by:
Hello, On Microsoft Visual Studio .NET 2003, I want to use some global elements, that can be used in each one of my pages. i.e I put a oleDBConnection on global.asax.vb How can I use it...
5
by: ad | last post by:
The Global.asax is code-inside with default. How to change Global.asax to code-behind?
0
by: Rick Hein | last post by:
I've got a problem with an app I've been working on, the Caching object and events not firing correctly. In a nutshell: When I'm debugging, and I set a breakpoint in the removed item call back, the...
3
by: Bragadiru | last post by:
Hi, I have 2 pbs : 1. When I'm using VS2005->Publish Web site => everything is pre-compiled fine (App_global.asax.dll is generated, too), except that I don't find Global.asax file in my...
11
by: Ron | last post by:
I have a web project compiled with the new "Web Deployment Projects" plugin for VS2005. I'm deploying the web project to one assembly and with updateable option set to ON. When I'm running the...
16
by: thefritz_j | last post by:
We just converted our VS2003 1.1 VB web project (which was working fine) to VS2005 2.0 and now I get: Parser Error Message: Could not load type '<Namespace>.'. Source Error: Line 1: <%@...
15
by: =?Utf-8?B?UGF0Qg==?= | last post by:
Just starting to move to ASP.NET 2.0 and having trouble with the Global.asax code file. In 1.1 I could have a code behind file for the global.asax file. This allow for shared variables of the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.