473,569 Members | 2,741 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Noob -- BC30002: Type 'Table' is not defined.

CJM
I'm finally taking my first few steps with ASP.NET, and I'm just workign my
way through some of the basics.

As a vehicle for my learning, I'm re-writing a simple report page for on of
my ASP applications.

I have two tables on this page. One is where the user requests a report for
a given ID number, the second is the table of result. Obviously I dont want
to show the results table until the query has been submitted, so I'm trying
to hide the table until IsPostBack = True.

As I understand it, I must declare the page controls, e.g. my tables, before
I can manipulate them in the CodeBehind page. I've done this but clearly I
am missing something because I am getting this error: BC30002: Type 'Table'
is not defined.

Thanks in advance

Chris

Code Snippets:

viewta.2aspx.vb :
Public Class viewta2
Inherits System.Web.UI.P age

Protected WithEvents tblResults As Table
Protected WithEvents tblRequest As Table
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
'Put user code to initialize the page here

If IsPostBack Then
'Hide Search button
tblResults.Visi ble = True
tblRequest.Visi ble = False
Else
'Hide(results)
tblResults.Visi ble = False
tblRequest.Visi ble = True
End If

End Sub

End Class
viewta2.aspx:
<%@ Page Inherits="viewt a2" src="viewta2.as px.vb" %>
<script runat="server">

Sub Page_Load
If Not IsPostBack Then
lblTANumber.vis ible=false
End If
End Sub

</script>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>viewta 2</title>
<meta name=vs_default ClientScript content="JavaSc ript">
<meta name=vs_targetS chema
content="http://schemas.microso ft.com/intellisense/ie5">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet " href="TADB.css" type="text/css">
</head>
<body MS_POSITIONING= "GridLayout ">

<form id="frmReport" method="post" runat="server">
<table id="tblRequest " class="tbl centered" cellspacing="0"
runat="server">
<tr>
<th colspan="2">Vie w TA Details</th>
</tr>
<tr>
<td>TA Number:</td>
<td><asp:TextBo x ID="txtTANumber " MaxLength="10" Runat="server"/></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><asp:Butt on ID="cmdSearch" Text="Search" Runat="server"/></td>
</tr>
</table>
<table id="tblResults " class="tbl centered" cellspacing="0"
runat="server">
<tr>
<th>TA Number:</th>
<th><asp:Labe l ID="lblTANumber " Width="10" Runat="server"/></th>
</tr>
<tr>
<td>PO Number:</td>
<td><asp:Labe l ID="lblPONumber " Runat="server"/></td>
</tr>
<tr>
<td>PO Line:</td>
<td><asp:Labe l ID="lblPOLine" Runat="server"/></td>
</tr>
<tr>
<td>Part No:</td>
<td><asp:Labe l ID="lblPartNo" Runat="server"/></td>
</tr>
<tr>
<td>Part XRef:</td>
<td><asp:Labe l ID="lblPartXRef " Runat="server"/></td>
</tr>
<tr>
<td>Description :</td>
<td><asp:Labe l ID="lblDescText " Runat="server"/></td>
</tr>
<tr>
<td>Quantity Rec'd:</td>
<td><asp:Labe l ID="lblQuantity Recd" Runat="server"/></td>
</tr>
<tr>
<td>Advice Note:</td>
<td><asp:Labe l ID="lblAdviceNo te" Runat="server"/></td>
</tr>
<tr>
<td>Supplier ID:</td>
<td><asp:Labe l ID="lblSuppierI D" Runat="server"/></td>
</tr>
<tr>
<td>Cert/Cast No:</td>
<td><asp:Labe l ID="lblCastNo" Runat="server"/></td>
</tr>
<tr>
<td>Date Rec'd:</td>
<td><asp:Labe l ID="lblDateRecd " Runat="server"/></td>
</tr>
</table>
</form>

</body>
</html>
Nov 18 '05 #1
7 2304
You haven't given it enough information about the class you're creating an
instance of. Try something like:

Protected WithEvents tblResults As System.Web.UI.W ebControls.Tabl e

Toby Mathews

"CJM" <cj*******@news groups.nospam> wrote in message
news:ei******** ******@TK2MSFTN GP09.phx.gbl...
I'm finally taking my first few steps with ASP.NET, and I'm just workign my way through some of the basics.

As a vehicle for my learning, I'm re-writing a simple report page for on of my ASP applications.

I have two tables on this page. One is where the user requests a report for a given ID number, the second is the table of result. Obviously I dont want to show the results table until the query has been submitted, so I'm trying to hide the table until IsPostBack = True.

As I understand it, I must declare the page controls, e.g. my tables, before I can manipulate them in the CodeBehind page. I've done this but clearly I
am missing something because I am getting this error: BC30002: Type 'Table' is not defined.

Thanks in advance

Chris

Code Snippets:

viewta.2aspx.vb :
Public Class viewta2
Inherits System.Web.UI.P age

Protected WithEvents tblResults As Table
Protected WithEvents tblRequest As Table
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
'Put user code to initialize the page here

If IsPostBack Then
'Hide Search button
tblResults.Visi ble = True
tblRequest.Visi ble = False
Else
'Hide(results)
tblResults.Visi ble = False
tblRequest.Visi ble = True
End If

End Sub

End Class
viewta2.aspx:
<%@ Page Inherits="viewt a2" src="viewta2.as px.vb" %>
<script runat="server">

Sub Page_Load
If Not IsPostBack Then
lblTANumber.vis ible=false
End If
End Sub

</script>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>viewta 2</title>
<meta name=vs_default ClientScript content="JavaSc ript">
<meta name=vs_targetS chema
content="http://schemas.microso ft.com/intellisense/ie5">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <link rel="stylesheet " href="TADB.css" type="text/css">
</head>
<body MS_POSITIONING= "GridLayout ">

<form id="frmReport" method="post" runat="server">
<table id="tblRequest " class="tbl centered" cellspacing="0"
runat="server">
<tr>
<th colspan="2">Vie w TA Details</th>
</tr>
<tr>
<td>TA Number:</td>
<td><asp:TextBo x ID="txtTANumber " MaxLength="10" Runat="server"/></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><asp:Butt on ID="cmdSearch" Text="Search" Runat="server"/></td>
</tr>
</table>
<table id="tblResults " class="tbl centered" cellspacing="0"
runat="server">
<tr>
<th>TA Number:</th>
<th><asp:Labe l ID="lblTANumber " Width="10" Runat="server"/></th>
</tr>
<tr>
<td>PO Number:</td>
<td><asp:Labe l ID="lblPONumber " Runat="server"/></td>
</tr>
<tr>
<td>PO Line:</td>
<td><asp:Labe l ID="lblPOLine" Runat="server"/></td>
</tr>
<tr>
<td>Part No:</td>
<td><asp:Labe l ID="lblPartNo" Runat="server"/></td>
</tr>
<tr>
<td>Part XRef:</td>
<td><asp:Labe l ID="lblPartXRef " Runat="server"/></td>
</tr>
<tr>
<td>Description :</td>
<td><asp:Labe l ID="lblDescText " Runat="server"/></td>
</tr>
<tr>
<td>Quantity Rec'd:</td>
<td><asp:Labe l ID="lblQuantity Recd" Runat="server"/></td>
</tr>
<tr>
<td>Advice Note:</td>
<td><asp:Labe l ID="lblAdviceNo te" Runat="server"/></td>
</tr>
<tr>
<td>Supplier ID:</td>
<td><asp:Labe l ID="lblSuppierI D" Runat="server"/></td>
</tr>
<tr>
<td>Cert/Cast No:</td>
<td><asp:Labe l ID="lblCastNo" Runat="server"/></td>
</tr>
<tr>
<td>Date Rec'd:</td>
<td><asp:Labe l ID="lblDateRecd " Runat="server"/></td>
</tr>
</table>
</form>

</body>
</html>

Nov 18 '05 #2
PS Syntax may not be exact, I'm a C# person!

"Toby Mathews" <to************ ***@yahoo.spamf ree.co.uk> wrote in message
news:cf******** **@thorium.cix. co.uk...
You haven't given it enough information about the class you're creating an
instance of. Try something like:

Protected WithEvents tblResults As System.Web.UI.W ebControls.Tabl e

Toby Mathews

"CJM" <cj*******@news groups.nospam> wrote in message
news:ei******** ******@TK2MSFTN GP09.phx.gbl...
I'm finally taking my first few steps with ASP.NET, and I'm just workign

my
way through some of the basics.

As a vehicle for my learning, I'm re-writing a simple report page for on

of
my ASP applications.

I have two tables on this page. One is where the user requests a report

for
a given ID number, the second is the table of result. Obviously I dont

want
to show the results table until the query has been submitted, so I'm

trying
to hide the table until IsPostBack = True.

As I understand it, I must declare the page controls, e.g. my tables,

before
I can manipulate them in the CodeBehind page. I've done this but clearly I am missing something because I am getting this error: BC30002: Type

'Table'
is not defined.

Thanks in advance

Chris

Code Snippets:

viewta.2aspx.vb :
Public Class viewta2
Inherits System.Web.UI.P age

Protected WithEvents tblResults As Table
Protected WithEvents tblRequest As Table
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
'Put user code to initialize the page here

If IsPostBack Then
'Hide Search button
tblResults.Visi ble = True
tblRequest.Visi ble = False
Else
'Hide(results)
tblResults.Visi ble = False
tblRequest.Visi ble = True
End If

End Sub

End Class
viewta2.aspx:
<%@ Page Inherits="viewt a2" src="viewta2.as px.vb" %>
<script runat="server">

Sub Page_Load
If Not IsPostBack Then
lblTANumber.vis ible=false
End If
End Sub

</script>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>viewta 2</title>
<meta name=vs_default ClientScript content="JavaSc ript">
<meta name=vs_targetS chema
content="http://schemas.microso ft.com/intellisense/ie5">
<meta http-equiv="Content-Type" content="text/html;

charset=ISO-8859-1">
<link rel="stylesheet " href="TADB.css" type="text/css">
</head>
<body MS_POSITIONING= "GridLayout ">

<form id="frmReport" method="post" runat="server">
<table id="tblRequest " class="tbl centered" cellspacing="0"
runat="server">
<tr>
<th colspan="2">Vie w TA Details</th>
</tr>
<tr>
<td>TA Number:</td>
<td><asp:TextBo x ID="txtTANumber " MaxLength="10" Runat="server"/></td> </tr>
<tr>
<td>&nbsp;</td>
<td><asp:Butt on ID="cmdSearch" Text="Search" Runat="server"/></td>
</tr>
</table>
<table id="tblResults " class="tbl centered" cellspacing="0"
runat="server">
<tr>
<th>TA Number:</th>
<th><asp:Labe l ID="lblTANumber " Width="10" Runat="server"/></th>
</tr>
<tr>
<td>PO Number:</td>
<td><asp:Labe l ID="lblPONumber " Runat="server"/></td>
</tr>
<tr>
<td>PO Line:</td>
<td><asp:Labe l ID="lblPOLine" Runat="server"/></td>
</tr>
<tr>
<td>Part No:</td>
<td><asp:Labe l ID="lblPartNo" Runat="server"/></td>
</tr>
<tr>
<td>Part XRef:</td>
<td><asp:Labe l ID="lblPartXRef " Runat="server"/></td>
</tr>
<tr>
<td>Description :</td>
<td><asp:Labe l ID="lblDescText " Runat="server"/></td>
</tr>
<tr>
<td>Quantity Rec'd:</td>
<td><asp:Labe l ID="lblQuantity Recd" Runat="server"/></td>
</tr>
<tr>
<td>Advice Note:</td>
<td><asp:Labe l ID="lblAdviceNo te" Runat="server"/></td>
</tr>
<tr>
<td>Supplier ID:</td>
<td><asp:Labe l ID="lblSuppierI D" Runat="server"/></td>
</tr>
<tr>
<td>Cert/Cast No:</td>
<td><asp:Labe l ID="lblCastNo" Runat="server"/></td>
</tr>
<tr>
<td>Date Rec'd:</td>
<td><asp:Labe l ID="lblDateRecd " Runat="server"/></td>
</tr>
</table>
</form>

</body>
</html>


Nov 18 '05 #3
CJM
Toby,

Seem you were on the right lines...

I'm working from example in "ASP Unleashed" where "Protected WithEvents
lblMessage as Label" was used... I wonder is their code wrong or are they
using some shortcut method?

Anyway, at first I changed to System.Web.UI.W ebControls.Tabl e... but this
meant I had to change all my <table>, <tr>, <th> and <td> tags needed to be
changed!

So I've opted for System.Web.UI.H tmlControls.Htm lTable - I know I'm missing
out on functionality, but I can't imagine I'm missing that much!

Cheers

Chris

[Addendum: I noticed that I can add Imports directives (eg Imports
System.Web.UI.H tmlControls) to allow shortcut declarations (eg. Protected
WithEvents tblResults As HtmlTable)]
"Toby Mathews" <to************ ***@yahoo.spamf ree.co.uk> wrote in message
news:cf******** **@thorium.cix. co.uk...
You haven't given it enough information about the class you're creating an
instance of. Try something like:

Protected WithEvents tblResults As System.Web.UI.W ebControls.Tabl e

Toby Mathews

Nov 18 '05 #4
Chris,

Yes, you can use Inherits to get the class to inherit everything from
another class like this:

Inherits System.Web.UI.W ebControls

like the line:

Inherits System.Web.UI.P age

you already have in your code (this inherits all the methods, classes etc of
the Page class, making them available from within your code without having
to type out everything from System up each time).

Hope this helps,

Toby

"CJM" <cj*******@news groups.nospam> wrote in message
news:u0******** ******@tk2msftn gp13.phx.gbl...
Toby,

Seem you were on the right lines...

I'm working from example in "ASP Unleashed" where "Protected WithEvents
lblMessage as Label" was used... I wonder is their code wrong or are they
using some shortcut method?

Anyway, at first I changed to System.Web.UI.W ebControls.Tabl e... but this
meant I had to change all my <table>, <tr>, <th> and <td> tags needed to be changed!

So I've opted for System.Web.UI.H tmlControls.Htm lTable - I know I'm missing out on functionality, but I can't imagine I'm missing that much!

Cheers

Chris

[Addendum: I noticed that I can add Imports directives (eg Imports
System.Web.UI.H tmlControls) to allow shortcut declarations (eg. Protected
WithEvents tblResults As HtmlTable)]
"Toby Mathews" <to************ ***@yahoo.spamf ree.co.uk> wrote in message
news:cf******** **@thorium.cix. co.uk...
You haven't given it enough information about the class you're creating an instance of. Try something like:

Protected WithEvents tblResults As System.Web.UI.W ebControls.Tabl e

Toby Mathews


Nov 18 '05 #5
HI Chris,

Since the ASP.NET has two set of controls Html SErver controls and
WEbserver controls, it's better that we declare a control as its full name.
And generally, if you don't need to create control from the html template
such as
<table runat=server> ...

Here are the related document in msdn:
You can just use the WebControls since that also provide better
encapsulation and flexibility.
#Introduction to ASP.NET Server Controls
http://msdn.microsoft.com/library/de...us/vbcon/html/
vbconintroducti ontowebformscon trols.asp

#HTML Server Controls
http://msdn.microsoft.com/library/de...us/cpgenref/ht
ml/cpconASPSyntaxF orHTMLControls. asp

Hope also helps. thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #6
CJM
I thought I'd reade somewhere that certain classes were automatically
inherited, but it appears not.

But it working fine now... well I'm on to my next problem actually, but I
can successfully manipulate the page controls from the form-behind page now,
thanks.

I would say, that for simple pages, there seem to be an awful lot of work to
do in comparison with ASP/PHP. I know that ultimately .NET is more powerful,
but for the simple stuff, there seems to be a lot of work to do...
Importing, inheriting, declaring form controls etc, etc...

Thanks anyway

Chris

"Steven Cheng[MSFT]" <v-******@online.m icrosoft.com> wrote in message
news:NA******** *****@cpmsftngx a06.phx.gbl...
HI Chris,

Since the ASP.NET has two set of controls Html SErver controls and
WEbserver controls, it's better that we declare a control as its full name. And generally, if you don't need to create control from the html template
such as
<table runat=server> ...

Here are the related document in msdn:
You can just use the WebControls since that also provide better
encapsulation and flexibility.
#Introduction to ASP.NET Server Controls
http://msdn.microsoft.com/library/de...us/vbcon/html/ vbconintroducti ontowebformscon trols.asp

#HTML Server Controls
http://msdn.microsoft.com/library/de...us/cpgenref/ht ml/cpconASPSyntaxF orHTMLControls. asp

Nov 18 '05 #7
Hi Chris,
Thanks for the followup. As for the ASP.NET web page, if the page is not
very complex, we can just use a aspx page which has functions inline rather
than provide a codebehind model. Here are some reference on this:

#Should I use Code-behind or Code-Inside (or Code-beside)?
http://msdn.microsoft.com/asp.net/co...e/default.aspx

#Web Forms Code Model
http://msdn.microsoft.com/library/de...us/vbcon/html/
vbconwebformsco demodel.asp

Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #8

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

Similar topics

1
6508
by: B R | last post by:
Hi, I am trying to use System.DirectoryServices for quering Active Directory, I am getting the following error Compiler Error Message: BC30002: Type 'DirectoryEntry' is not defined. Why I am getting this error ? Any Help will be appriciated.
0
1576
by: Jim Hansen | last post by:
I re-installed Framework and now I am getting this error ClassBrowser. Most other page work just fine. Additionally, the debugger will not start from Visual Studio 2003.. Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details...
0
1845
by: Nuve | last post by:
I followed the instructions on the Microsoft article (http://support.microsoft.com/default.aspx?scid=kb;en- us;326340) on HOW TO: Authenticate against the Active Directory by Using Forms Authentication and Visual Basic .NET. After completing and running the page I get the following error message on the Logon.aspx file: Compiler Error...
0
1450
by: ADE | last post by:
Hi, I am compiling my ASP.NET /VB.NET code without any errors But on running the .aspx file on the browser i m getting an error like BC30002 type <classname> not defined.I am getting a similar error for ADODB also despite adding a proper reference. The classname is a name of a user defined class.
2
1692
by: Jason Callas | last post by:
I have a simple class written in vb.net: 'SongsDb.vb Imports System.Configuration Imports System.Data Imports Microsoft.Data.Odbc Namespace AquehongaPortal Public Class SongsDb Public Function GetSongs() As DataSet
2
8319
by: David Lozzi | last post by:
This script is in the code-behind. This is a repost of a reply in "Name 'IsNumeric' is not declared??'. I wanted to post it under a different subject. Type 'EventArgs' is not defined at Sub updateStore(ByVal sender As Object, ByVal e As EventArgs) I appear to be missing somehting here?
4
14835
by: Gina | last post by:
I get this error: BC30002: Type 'Intranet.dsScreenShow' is not defined. My page works on my machine but when put on the server I get the above error. Any ideas why? PS Intranet is my namspace. Sorry to not be much help - I inherited the page from someone else and it all works except on the server. Thanks!
0
1402
by: =?Utf-8?B?amFzbGVndW1l?= | last post by:
The error Compiler Error Message: BC30002: Type 'CUNAMutual.CorporateComponents.PageTemplate' is not defined. I have some corporate components that are used as styles for page uniformity. These components have been installed and are part of the reference on the web site. They are also part of the list on the project properties. I have...
1
2567
by: JoeP | last post by:
Hi All, I have class named xRep.vb located at the App_Code folder. The below works just fine under the Visual Studio environment, but when running this code from the web server I am getting this err: Compiler Error Message: BC30002: Type 'xRep' is not defined. I copied the class even to the same folder of the aspx and the vb page. Dim...
0
7700
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8125
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7676
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3642
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1221
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.