0

Hi All,

First post here so be gentle! I'm working through Sams Teach Yourself ASP.Net book and have come across an error with one of the basic examples. The example is to do with .vb and .aspx files and compiling them.

I have succesfully compiled the database.vb file. The contents of database.vb is as follows:

Imports System
Imports System.Data
Imports System.Data.OleDb

Namespace TYASPNET

Public Class Database
End Class
End Namespace

The database.aspx file is as follows:

<%@ Language="VB" %>

<script runat="server">
	sub Page_Load(Sender as Object, e as EventArgs)
	dim objDatabase as new TYASPNET.Database
	lblMessage.Text = "Object Created"
	end sub
</script>

<html><body>
<asp:Label id="lblMessage" runat="server" />
</body></html>

Once compiled the database.dll file is located in the same director as database.vb and database.aspx - is this correct?

When accessing database.aspx the following error occurs:

BC30002: Type 'TYASPNET.Database' is not defined.

I know it must be something simple, but being new to all this I don't know what it is!

Can anyone help? Once this is sorted out it will sort out my other aspx files as I'm having the same problem with them.

Thanks

DJ

2
Contributors
3
Replies
4
Views
12 Years
Discussion Span
Last Post by Paladine
0

You have missed the Registration of the dll line of code for the page to grab that dll.
<% @.... %>

The books states it.

Double check your code.

My book is at home so I can't give you the exact code right off the top of my head.

:cool:

Hi All,

First post here so be gentle! I'm working through Sams Teach Yourself ASP.Net book and have come across an error with one of the basic examples. The example is to do with .vb and .aspx files and compiling them.

I have succesfully compiled the database.vb file. The contents of database.vb is as follows:

Imports System
Imports System.Data
Imports System.Data.OleDb

Namespace TYASPNET

Public Class Database
End Class
End Namespace

The database.aspx file is as follows:

<%@ Language="VB" %>

<script runat="server">
	sub Page_Load(Sender as Object, e as EventArgs)
	dim objDatabase as new TYASPNET.Database
	lblMessage.Text = "Object Created"
	end sub
</script>

<html><body>
<asp:Label id="lblMessage" runat="server" />
</body></html>

Once compiled the database.dll file is located in the same director as database.vb and database.aspx - is this correct?

When accessing database.aspx the following error occurs:

BC30002: Type 'TYASPNET.Database' is not defined.

I know it must be something simple, but being new to all this I don't know what it is!

Can anyone help? Once this is sorted out it will sort out my other aspx files as I'm having the same problem with them.

Thanks

DJ

0

Thanks. I fixed it by putting the dlls in the bin directory.

thanks

0

Cool

The line you need for those that don't know :

<%@ Register TagPrefix="TYASPNET" TagName="LoginForm" src="LoginForm.ascx" %>

Thanks. I fixed it by putting the dlls in the bin directory.

thanks

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.