Newbie question: migrating "global variables" from ASP to ASP.

Newbie question: migrating "global variables" from ASP to ASP.

Post by QW5kcmVhcy » Tue, 19 Apr 2005 22:53:07

Thanks for your response Bruce, seems to make a lot of sense what you
propose - but I still have some questions or problems, perhaps because I'm
just missing some vital insight (or perhaps because I just bought the wrong
book to learn ASP.NET, which I think I did)

You propose:

As I said, that sounds like a good idea, but I'm not able to get it to
work. I've put all the old global variables and helper functions into a
class-block and then I tried to have my .aspx-file inherit from that class -
but I'm at a loss how to make it work.

My problem begins with the simple fact that I don't know what to put into
the Inherits="..." area. You've made it "MyStuff.Globals" but I don't get the
"MyStuff"-part. "Globals" is the name of the class, that's clear, so I need
to put

Publich Class Globals
End Class

in some .aspx or .aspx.vb file - and then I've tried to make my main
.aspx-file inherit from that class by adding

<%@ Page Language="vb" AutoEventWireup="false" Inherits="Globals" %>

but that only ends with the parser saying:

Parser Error Message: Could not load type 'Globals'

I'm sure it's some stupid mistake I'm doing here, but I don't get it yet.
Could you perhaps show me how I'd have to design the two files in question to
make it work? The one file would be the rewritten "include"-file with the
definition of the "Globals"-class, and the other file being the page doing
the actual work. I'd expect them to be something like this:

Public Class Globals
Inherits System.Web.UI.Page
Dim ASPFile As String
' ...more "global variables" as needed
End Class

<%@ Page Language="vb" Inherits="Globals" %>
<form action="<% Response.Write( ASPFile ) %>">

Am I thinking totally wrong here? How do I make it clear for the
parser/compiler that I want to use the class "Globals" which is defined in
the file "include.aspx"? *wonders*

Still quite confused und feeling new(b)ish

Andreas Hofmann

1. newbie: how to use global ASP variable in jscript?

2. Newbie Question: Asp Classic and ASP.NET running on IIS5 side-by-side ?

From: "Bob [BVP]" < XXXX@XXXXX.COM >
Subject: Newbie Question: Asp Classic and ASP.NET running on IIS5 side-by-side ?
Date: Friday, August 06, 2004 12:29 PM

I want to start taking advantage of and the framework, but
I am little concerned about installing the .net framework support
on my production iis5 server. Are they any gottcha's I need to
be aware, and can they run side-by-side without issues ? I've
gone over the server requirements/updates, and all I need to do is install
it now.. In the grips of installation fear at the moment..

Thanks in advance,

3. Mantain a variable through several scripts like global.asa variables in asp

4. Newbie Question: Global variable vs. Top-level variable

5. migrating from ASP.NET 2.0 BETA to ASP.NET 2.0

6. Migrating ASP & COM+ to ASP .NET

7. Remote Scripting - Migrate ASP to ASP.NET

8. migrating ASP to ASP.NET

9. How to convince client to migrate from ASP to ASP.NET

10. input form migrated from asp to

11. Length of an if statement in dotnet (migrating from asp to

12. Problem migrating ASP.NET 1.1 to ASP.NET 2.0 beta using VS2005

13. Migrate ASP 3.0 applications to ASP.NET

14. ASP Interview Questions ASP Interview Questions