Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old June 27th, 2005, 10:42 AM
Authorized User
 
Join Date: May 2004
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Using Include statements in ASP.NET

I have a Utilities.vb page that contains a number of classes (not compiled) being referenced by a number of (in-line coded) aspx pages.

Since I'm not too familiar with either ASP or ASP.NET, I was wondering if the statement used extensively in ASP classic:
Code:
Code:

would still apply in .NET in this context.

This application was not created using a Visual Studio Project, and the above referenced Include statement doesn't work as the server keeps returning:

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.

BC30002: Type 'Utilities.DPAPI' is not defined.

etc. etc.........

  #2 (permalink)  
Old June 27th, 2005, 01:58 PM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

You cannot use include files as far as I know in ASP.Net. You can convert it to a vb class file and use that in your aspx pages.

  #3 (permalink)  
Old June 27th, 2005, 02:13 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,409
Thanks: 0
Thanked 16 Times in 16 Posts
Default

As Jim has pointed out, non-precompiled ASP.NET can not take advantage of supporting classes. You'll need to compile at least those support/utility classes into an assembly that is accessible by the pages.

-Peter
  #4 (permalink)  
Old June 28th, 2005, 08:36 AM
Authorized User
 
Join Date: May 2004
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Jim, Peter,

Thank you for the replies. You were right, and I found at least two ways of solving this issue:

+ I could use the script tag, and specify the source file in the src attribute:
Code:
<script runat="server" language="vb" src="Utilities.vb" />
+ I could use the Assembly directive in the web page to point to the code file:
Code:
<%@ Assembly Name="MyWebApp" %>
<%@ Assembly Src="Utilities.vb" %>
Thanks again,

b-d

 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can i use asp within sql statements knight Classic ASP Databases 43 May 24th, 2007 09:32 AM
include style in asp.net Magen ASP.NET 1.0 and 1.1 Basics 3 February 26th, 2007 06:14 PM



All times are GMT -4. The time now is 06:22 PM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.