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

Visual Web Developer 2005 Classes in Code Folder Problem

I have an aspx page that does not have a separate source for the VB - it is
on top in between the <script> tags. I use the following statement

Dim oComLib as New ComLib

To reference a class called ComLib in a source member called ComLib.vb that
is found in the /Code folder of my project. It all works fine in the VWD2005
environment as when I run the aspx page, it processes the above statment and
"sees" the class reference in the code.

When I upload the /Code folder (and its contents) to a remote web server
running the 1.1 environment and then upload the .aspx page (which isn't in
the /Code folder) when the page comes across the above statement, I get the
error below. My questions are:

1) How do I get the .aspx page to "see" the ComLib class source file that is
in the /Code folder (which is where VWD2005 dictates it should be put if you
want it to be "generally consumable")
2) I don't want to /bin dll any of this, I want it all to interpret and
compile on the fly
3) Do I need to register the /Code/ComLib.vb on the 1.1 server in some way?
4) If I need to do a /bin dll using VWD2005, how do I do it as when I do a
build, nothing is put into a /bin folder
5) When I ran another .aspx page built in VWD2005 and uploaded to the same
remote web server that didn't reference anything like the /Code/ComLib.vb, it
ran fine without creating a dll and just having all the vb/html source within
one .aspx

Finally, the source member for class /Code/ComLib.vb has as it's first
statement

Public Class ComLib

so that should make it be referenced anywhere.

If someone could help that would be great - I searched and could not find
anything on this subject.

---------------------------------------------------------------------------------------------
Compilation Error
Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.

Compiler Error Message: BC30002: Type 'ComLib' is not defined.

Source Error:

Line 2: <script runat="server">
Line 3:
Line 4: Dim oComlib As New ComLib
Line 5:
Line 6: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
---------------------------------------------------------------------------------------------

Nov 19 '05 #1
7 1253
"tonelab" <to*****@discussions.microsoft.com> wrote in message
news:07**********************************@microsof t.com...
I have an aspx page that does not have a separate source for the VB - it is
on top in between the <script> tags. I use the following statement

Dim oComLib as New ComLib

To reference a class called ComLib in a source member called ComLib.vb
that
is found in the /Code folder of my project. It all works fine in the
VWD2005
environment as when I run the aspx page, it processes the above statment
and
"sees" the class reference in the code.

When I upload the /Code folder (and its contents) to a remote web server
running the 1.1 environment and then upload the .aspx page (which isn't in
the /Code folder) when the page comes across the above statement, I get
the
error below. My questions are:


VWD2005 works with Framework 2.0, not 1.1.

John Saunders
Nov 19 '05 #2
<, VWD2005 works with Framework 2.0, not 1.1. >>

That's not completely true - I have created standalone .aspx pages in
VWD2005 that have both vb source and html in one .aspx file, uploded that
..aspx file to a 1.1 server and it runs just fine without creating a /bin dll.
It no different than creating an all inclusive .aspx file in WebMatrix and
uploading it to a 1.1 machine. So your statement is not completely correct -
you can create an .aspx page in VWD2005 that doesn't use a codebehind file
but rather is all-in-one, upload it to a 1.1 server and it will run perfectly.

Your statement is correct in that VWD2005 needs the 2.0 framework for
development purposes.

Can anyone else help me with the /Code folder question i posted previously?

Or is the only way that a 1.1 server can see a class file in a /code folder
(or anyo other folder for that matter) is by creating the /bin dll?
Nov 19 '05 #3
"tonelab" <to*****@discussions.microsoft.com> wrote in message
news:E8**********************************@microsof t.com...
<, VWD2005 works with Framework 2.0, not 1.1. >>

That's not completely true - I have created standalone .aspx pages in
VWD2005 that have both vb source and html in one .aspx file, uploded that
.aspx file to a 1.1 server and it runs just fine without creating a /bin
dll.
It no different than creating an all inclusive .aspx file in WebMatrix and
uploading it to a 1.1 machine. So your statement is not completely
correct -
you can create an .aspx page in VWD2005 that doesn't use a codebehind
file
but rather is all-in-one, upload it to a 1.1 server and it will run
perfectly.


Actually, you're just using VWD2005 as a fancy text editor. You could have
created the same application in Notepad, with the same amount of success.

The reason being that 1.1 doesn't know anything about a Code folder, or
about compiling code on the fly. That's a 2.0 feature.

John Saunders
Nov 19 '05 #4
Thanks for your perseverence in anwering this thread. Perhaps I can simplify
with an example:
-------------------------------------------------------------------
This file is called stored in /Code/ClassFile.vb

Imports System
Namespace ClassFile
Public Class ClassFile1
Public function GetTimer() as string
GetTimer = Timer.ToString
End Function
End Class
End Namespace
-----------------------------------------------------------------------------
This all in one page is saved in /Content/WebPage1.aspx

<%@ Page Language="VB" %>
<%@ Import Namespace="ClassFile"%>
<script runat="server">

' Insert page code here
'
dim oClassFile as new ClassFile1
Sub Button1_Click(sender As Object, e As EventArgs)
Button1.Text = oClassFile.GetTimer
End Sub

</script>
<html>
<head>
</head>
<body>
<form runat="server">
<asp:Button id="Button1" onclick="Button1_Click" runat="server"
Text="Button"></asp:Button>
<!-- Insert content here -->
</form>
</body>
</html>
----------------------------------------------------------------------
How do I make this work in 1.1 so that WebPage1.aspx can call the class
saved in ClassFile.vb without compiling a /bin dll? The inherits doesn't seem
to do it. All I really want is to be able to use a class found in another
source member. There has to be something that tells it where to look for
additional stuff.

The old asp way was to just put your classes into a source file and then use
the #include statement, to use an analogy.

Thanks
George
Nov 19 '05 #5
"tonelab" <to*****@discussions.microsoft.com> wrote in message
news:33**********************************@microsof t.com...
Thanks for your perseverence in anwering this thread. Perhaps I can
simplify
with an example:
-------------------------------------------------------------------
This file is called stored in /Code/ClassFile.vb

Imports System
Namespace ClassFile
Public Class ClassFile1
Public function GetTimer() as string
GetTimer = Timer.ToString
End Function
End Class
End Namespace
-----------------------------------------------------------------------------
This all in one page is saved in /Content/WebPage1.aspx

<%@ Page Language="VB" %>
<%@ Import Namespace="ClassFile"%>
<script runat="server">

' Insert page code here
'
dim oClassFile as new ClassFile1
Sub Button1_Click(sender As Object, e As EventArgs)
Button1.Text = oClassFile.GetTimer
End Sub

</script>
<html>
<head>
</head>
<body>
<form runat="server">
<asp:Button id="Button1" onclick="Button1_Click" runat="server"
Text="Button"></asp:Button>
<!-- Insert content here -->
</form>
</body>
</html>
----------------------------------------------------------------------
How do I make this work in 1.1 so that WebPage1.aspx can call the class
saved in ClassFile.vb without compiling a /bin dll? The inherits doesn't
seem
to do it. All I really want is to be able to use a class found in another
source member. There has to be something that tells it where to look for
additional stuff.


Sorry, there isn't anything like this. It's a 2.0 feature.

John Saunders
Nov 19 '05 #6
so the bottom line to this whole long thread is that in 1.1 without creating
a /bin dll, there is no way for a codebehind vb file to see anything outside
of it's file and there is no way to emulate the old asp include= statement to
"bring in" any code from an external source file, is that correct?

what a shame.

George
Nov 19 '05 #7
"tonelab" <to*****@discussions.microsoft.com> wrote in message
news:D8**********************************@microsof t.com...
so the bottom line to this whole long thread is that in 1.1 without
creating
a /bin dll, there is no way for a codebehind vb file to see anything
outside
of it's file and there is no way to emulate the old asp include= statement
to
"bring in" any code from an external source file, is that correct?


There are very good reasons why the old way is the old way. For instance, if
you #include a class into one file, and also #include it in another, are
they the same class, or different classes?

This isn't scripting, it's programming. It's different.

John Saunders
Nov 19 '05 #8

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

Similar topics

2
by: dimension | last post by:
Hi, in visual studio 2005 beta, when i type "using System.Web." no code complete helper pops up. Similarly, when typing "using System.Net." i do not see an HttpWebRequest in the list that pops...
2
by: Eugene | last post by:
Can we use Visual Source Safe to keep MS Access files? What are the pros and cons. Any refernces and links on that topic. Thanks, Eugene
5
by: Patrick Olurotimi Ige | last post by:
Hi, I have VStudio.Net 2003 installed but can i install Visual Web Developer also on the same PC. My current .Net Frameork version is 1.1. Will the Visual Web Developer install ASP.NET 2.0? And...
3
by: Steve Richter | last post by:
I have discovered that my web appl developed using the visual web developer 2005 freebie will not work on my godaddy.com web hoster. So I am using Visual Studio .Net 2003 Enterprise Architect...
8
by: William LaMartin | last post by:
I just received my Visual Studio upgrade to 2005 and tried to create a new web site via File | New Web Site with location http. Unfortunately I received the following error: "Visual Web...
0
by: William LaMartin | last post by:
It was suggested that I post this query here rather than in the Microsoft.public.dotnet.languages.vb group. I just received my Visual Studio upgrade to 2005 Pro and tried to create a new web...
54
by: m.roello | last post by:
In the book: "Working with Microsoft Visual Studio 2005" Craig Skibo wrote: "The power of Visual Studio 2005 lies in its ability to empower users to build, test, and debug powerful applications...
0
jwwicks
by: jwwicks | last post by:
Introduction This tutorial describes how to use Visual Studio to create a new C++ program, compile/run a program, resume work on an existing program and debug a program. It is aimed at the...
1
by: Puja Patel | last post by:
hi all, am not sure if this is the right place for this post. I created a website on .net framework 2.0 using visual studio 2005 and web service software factory. I created all my business...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
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...

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.