I am using VB in VWD 2005 to write a web application.
I have stored my code for several custom VB classes in the App_Code folder.
When I run my application locally from VWD it runs fine.
When I run the Application from the web server, I get an error from any code from my WebpageName.axp x.vb files that use my class code.
For example, lines such as
Dim MO as new MyObject
Give me the following error
Compiler Error Message: BC30002: Type 'MyObject' is not defined
I have defined MyObject as a public class in the App_Code folder, so I don't understand why I get this error message?
Any insight would be greatly appreciated. To see the error message I am currently receiving, you can go to, Example
Make a selection and press the button.
10 2794
Hi
i can see here in you example that you have an error after a user has selected an option and click a button.
Dim P As New PageSetup ' the error
PageSetup is a dll, right?
and you referenced that in your local copy?
I am using VB in VWD 2005 to write a web application.
I have stored my code for several custom VB classes in the App_Code folder.
When I run my application locally from VWD it runs fine.
When I run the Application from the web server, I get an error from any code from my WebpageName.axp x.vb files that use my class code.
For example, lines such as
Dim MO as new MyObject
Give me the following error
Compiler Error Message: BC30002: Type 'MyObject' is not defined
I have defined MyObject as a public class in the App_Code folder, so I don't understand why I get this error message?
Any insight would be greatly appreciated. To see the error message I am currently receiving, you can go to, Example
Make a selection and press the button.
is inside some other namespace?
Reference PageSetup from its namespace. - Dim P As New Namespace.PageSetup
where NameSpace is the namespace in which PageSetup Resides.
cheers
Thank you for your advice,
I don't know a lot about .dll files, so I did not consciously create any. I am still pretty new at .NET and web programming in general. I did not know about namespace before today. I put my classes in a namespace and changed my declarations as per your suggestions. I added an Import Line at the top of each of my Aspx.vb pages to import the namespace. ( I hope this is the correct way to go about this). All is well when I run it in VWD. I will post a response after It's been loaded to the server.
Thank you again for your help.
I am still getting an error, but a slightly different error.
Compiler Error Message: BC30002: Type 'Oct8_2007.Page Setup' is not defined.
and
Warning: BC40056: Namespace or type specified in the Imports 'Oct8_2007' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.
To See for the error for yourself click on the link below, make a selection from the drop down and press the button. Example 2
In ClassesOct82007 .VB in my App_Code folder I have the following code (actuall Class Code rolled up for readability):
Imports Microsoft.Visua lBasic
Imports System.Data.Ole Db
Imports System.Data - ' Last Edited 10/8/2007
-
Namespace Oct8_2007
-
Public Class OrganClasses…
-
Public Class DataControl…
-
Public Class LabelControl…
-
Public Class MySearch…
-
Public Class PageSetup…
-
Public Class Selection…
-
Public Class UsageDBClass…
-
Public Class UserDBClass…
-
Public Class DownloadMDBClass…
-
End Namespace
The relevant code in the Page.asxp.vb file is - Imports System.Data.OleDb
-
Imports System.Data
-
Imports Oct8_2007
-
-
Partial Class _Default
-
Inherits System.Web.UI.Page
-
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
-
' Page Load Ver 9/2/2007
-
If Not Page.IsPostBack Then
-
Dim P As New Oct8_2007.PageSetup
-
P.SetUpPage(Page, pTableID)
-
End If
-
End Sub
-
End Class
I appreciate any advice you might have.
Does anyone have any advice on how let me use my custom VB classes when I put my project on the server? I don't quite understand why it works with Visual Web Developer, but not when I put my project on the web server?
Does anyone have a link to using custom namespaces?
Am I using the syntax for namespaces incorrectly, or am I conceptually misunderstandin g namespaces in general?
Thank you for advice or links you might offer.
~ Dan
Have you got a definition for Pagesetup in that namespace?
By definition do you mean code for my PageSetup class? I've pasted (a trimmed down version) of my PageSetup class. I've wrapped in (my understanding of) a Namespace class.
In the .vb code file for each of my Aspx.net web pages I've added an Imports Oct8_2007 statement.
Is that the correct syntax?
In ClassesOct82007 .vb contained in the App_Code folder. - Namespace Oct8_2007
-
Public Class PageSetup
-
Private pPage As Page
-
Private pTableName As String
-
Private pCurrentControl As Control
-
Private pBadDataMessage As String = ""
-
Public oFunctions As New Oct8_2007.OrganClasses
-
Public LabelFormatsTable As New DataTable
-
Private ChoicesTable As New DataTable
-
-
Public Sub SetUpPage(ByVal Page As Page, ByVal TableName As String)
-
pPage = Page
-
pTableName = TableName
-
Dim MS As New Oct8_2007.MySearch
-
ChoicesTable = MS.Search("ChoicesDB", TableName, , , , , , , , , "Order")
-
'LabelFormatsTable = MS.Search("FormatsdB", TableName, "P", "0")
-
Call SetUpChoices()
-
End Sub
-
End Class
-
End Namespace
Researched a bit over this.
Are you using DotNetNuke by any chance?
I tried searching for that error code...but all lead to having dotnetnuke in them
Hope someone from that expertise can help you
Not that I'm aware of. I'm not sure what DotNetNuke is.
I've been creating the web project in Visual Web Developer. I will keep researching and post back if I find success. Thank you for your help.
I just wish I knew why it works in VWD but not when I save it to the server.
This is the most closely related post I've found so far is, http://forums.asp.net/p/1087606/1622594.aspx#1622594
Thanks again.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Ken Allen |
last post by:
I have a .net client/server application using remoting, and I cannot get the
custom exception class to pass from the server to the client. The custom
exception is derived from ApplicationException and is defined in an assembly
common to the client and server components. The custom class merely defines
three (3) constructors -- the null constructor; one with a string parameter;
and one with a string and innner exception parameter -- that...
|
by: TC |
last post by:
I have an Access database application with a lot of custom row
functions written in VBA. In other words, a lot of queries contain
calculated fields which use functions defined in the modules.
I am now thinking about upgrading the database from Access to SQL
Server. If I do, how can I implement the custom row functions? Is
Visual Basic integrated with SQL Server just as it is with Access? Or
does T-SQL in SQL Server offer the...
|
by: Pat |
last post by:
In my Web.config i have :-
<customErrors mode="On" defaultRedirect="genericerror.htm">
<error statusCode="404" redirect="pagenotfound.aspx"/>
</customErrors
to get page not found error but instead i keep getting a RUN TIME error
below:
Any ideas..
Runtime Error
|
by: Adam |
last post by:
Im trying to add an httphandler for all *.sgf file extensions. I have
developed the handler,
1. installed it into the gac
2. added it to the machine.config:
<httpHandlers>
<add verb="*" path="*.sgf" type="CustomExtensionHandler,
Extenders.CustomExtensionHandler, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=d831d925597c1031" validate="True"/>
</httpHandlers>
|
by: Graham |
last post by:
I have created a custom MembershipProvider called "LassieMembershipProvider"
that derives from "MembershipProvider". This providor is located in a
Businesslogic layer dll called "Enlighten.LinkMad.Businesslogic". In one of
my frontend websites I use this type to authenticate a user who is trying to
login.
The following excerpt is from the web.config of the particular site showing
the reference to the custom provider, allowing .Net to do...
| |
by: bryan |
last post by:
I've got a custom HttpHandler to process all requests for a given
extension. It gets invoked OK, but if I try to do a Server.Transfer I
get an HttpException. A Response.Redirect works, but I really need to
avoid the extra round-trip to the client.
I've tried Passing the page name, the full URL, and the instance of
the handler class to the Transfer method, but everything gets me the
same error 500.
Any help would be appreciated.
|
by: rizwanahmed24 |
last post by:
Hello
i have made a custom control. i have placed a panel on it. I want this
panel to behave just like the normal panel. The problem i was having is
that the panel on my custom control doesnt accept other controls. The
control i drag drop on it becomes the child of my custom control's
parent form and not the child of my custom control. Then i added this
line
""
before my custom control class (i dont know what this line does). Now
|
by: Alias |
last post by:
Hi -
I'm trying to implement a custom RoleProvider based on the SqlRoleProvider.
I keep receiving a an error that it can't load type
'MyRoleTest.MyRoleProvider' when trying to load my RoleProvider. However
this only occurs after deployment. On my local machine it works fine. So I
created the most basic role provider project I could think of. It is below:
Imports System.Web.Security
|
by: =?Utf-8?B?YWJheWVy?= |
last post by:
In short: I have an application using the CommittableTransaction class that
works fine when run locally, but does not escalate to MSDTC when deployed to
a Windows 2003 R2 server.
More Specifically:
I have a web service that saves data to a database. This service uses a
CommittableTransaction to decide when to Commit or Abort the underlying
|
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 usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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 launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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 into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| | |