473,386 Members | 1,830 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,386 software developers and data experts.

Classes undefined

I actually have 2 questions:

1) I am getting an error "Type 'TempClass1' is not defined"

Why?

Here is my DLL, where I have 3 classes defined outside of my Web Class:
AuthHeader, ServiceTicket and TempClass1
************************************************** ************************
<%@ WebService Class="SecureService" debug="True"%>

Imports System
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Data
Imports System.Data.SqlClient

<WebService( Namespace:="http://10.0.0.25/webservices" )> _
Public Class SecureService : Inherits WebService

Public AuthenticationHeader As AuthHeader

<WebMethod()> Public Function Login( username As String, password As
String ) As ServiceTicket

End Function

End Class

Public Class AuthHeader:Inherits SoapHeader
Public SessionKey As String
End Class

Public Class ServiceTicket:Inherits AuthHeader
Public IsAuthenticated As Boolean
Public SessionKey As String
Public Expiration As DateTime
End Class

Public Class TempClass1:Inherits ServiceTicket
Public TomsClass1Name As String
End Class
************************************************** **********************

My Web page is :
************************************************** *******************
<%@ Import Namespace="Services" %>

<Script runat="Server">

Sub Page_Load
Dim objSecureService As SecureService
Dim objServiceTicket As ServiceTicket
Dim objAuthHeader As AuthHeader
Dim objTempClass1 As TempClass1

objSecureService = New SecureService
objServiceTicket = Session( "ServiceTicket" )
objTempClass1 = new TempClass1

</Script>

<html>
<head><title>TestSecureService.aspx</title></head>
<body>

<asp:Label
id="lblLuckyNumber"
EnableViewState="False"
Runat="Server" />

</body>
</html>
************************************************** ********************

Why do I only get an error on TempClass1 and not on the others?

It turns out I can modify the Login function to all three class without any
problem, like:
************************************************** *****************
<WebMethod()> Public Function Login( username As String, password As
String ) As ServiceTicket
Dim objServiceTicket As new ServiceTicket
Dim objAuthHeader As new AuthHeader
Dim objTempClass1 As new TempClass1

End Function
************************************************** ****************

So I can call all these classes, which makes sense as they are all in the
same file.

But why can I use ServiceTicket and AuthHeader, but not TempClass1??????

They are defined the same way. They are in the same file.
2) In my Web page I have:

<%@ Import Namespace="Services" %>

But I don't have Namespace Services. Is this an MS Namespace?

Thanks,

Tom

Apr 3 '06 #1
0 816

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

Similar topics

31
by: Axel Dahmen | last post by:
I try to combine properties of several classes. This is done by assigning a space separated list of class definitions to an element. However, IE shows a kind of preference when choosing the right...
12
by: Daedalus.OS | last post by:
Ok first I'm pretty new to OOP, so my question may sound stupid to some of you. If the only answer you can provide is "get a book about OOP" then don't loose your time and mine cause it's already...
2
by: Dave Veeneman | last post by:
Is is legal to declare abstract members in non-abstract classes? How about non-abstract members in abstract classes? I am writing a base class with three derived classes. The base class will...
11
by: Kevin Prichard | last post by:
Hi all, I've recently been following the object-oriented techiques discussed here and have been testing them for use in a web application. There is problem that I'd like to discuss with you...
19
by: scroopy | last post by:
Is it impossible in C++ to create an assignment operator for classes with const data? I want to do something like this class MyClass { const int m_iValue; public: MyClass(int...
13
by: Jack | last post by:
I have a class called "Base". This class has a protected member variable "m_base" which can be retrieved using the public member function "GetBaseMember". "m_base" is initialized to "1" and is...
17
by: Jess | last post by:
Hello, If I have a class that has virtual but non-pure declarations, like class A{ virtual void f(); }; Then is A still an abstract class? Do I have to have "virtual void f() = 0;"...
2
by: pssraju | last post by:
Hi, At present application was built on solaris 9 using sun studio 9 (Sun C++ 5.6) & rouguewave sorce pro 5. We are planning to port the same application onto SuSE Linux 9.5.0 using GCC 3.3.3 & RW...
7
by: Jim | last post by:
Hi, I'm trying to build a simple data table for all my classes to use. I don't want to use a vector. The data is stored in class freqoffset class freqoffset { public:...
6
by: Immortal Nephi | last post by:
First class is the base class. It has two data: m_Base1 and m_Base2. Second class and third class are derived classes and they are derived from first class. m_Base1 and m_Base2 are inherited into...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.