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

Scope of a Public Module in a Web Environment

Hi All

I have been tryign to figure out the scope of a module as
shown declared below in a web environment.

My Questions are

Is this module shared across multiple instances of the
application ??
What about variables declared in global scope of this
module ? How does asp.net treat something like that ?

Public Module modModuleName

Dim m_objDatabaseConnection as new sqlconnection
(connectionstring)
End Module
Any help would be appreciated

Thanks & Regards

Ashish Shridharan
Nov 17 '05 #1
2 1490
A module is marked as shared in Visual Basic. The global information will
be shared across applications in a web application.

Thank you, John Soulis
Microsoft, ASP.NET

This posting is provided "AS IS", with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Nov 17 '05 #2
I'm not sure what you mean by module because these concept no longer exists
in .NET. It's a vb term. It could be vb.NET so in that case excuse my
ignorance cause I don't know much vb.net. It all depends on where you
declare your 'module'. If you place it in the application global.asax then
it has global scope and lasts till the application stops, which means it
will be around even if users log in and log off. Typically the application
stops after iis is reset or some other event causes the application to
recycle.
Is this module shared across multiple instances of the
application ?? I'm not sure what you mean by this either. A web application has one
application object per application domain.

Scope determines how long the object lasts. If you declare this inside a
class, it lasts for as long as the class is around, for the most part.
--
-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
"Ashish Shridharan" <ne*******@yahoo.com> wrote in message
news:09****************************@phx.gbl... Hi All

I have been tryign to figure out the scope of a module as
shown declared below in a web environment.

My Questions are

Is this module shared across multiple instances of the
application ??
What about variables declared in global scope of this
module ? How does asp.net treat something like that ?

Public Module modModuleName

Dim m_objDatabaseConnection as new sqlconnection
(connectionstring)
End Module
Any help would be appreciated

Thanks & Regards

Ashish Shridharan

Nov 17 '05 #3

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

Similar topics

4
by: Hugh Macdonald | last post by:
We're starting to version a number of our python modules here, and I've written a small function that assists with loading the versioned modules... A module would be called something like:...
9
by: Steven T. Hatton | last post by:
It was once suggested to me that I could accomplish much the same thing that modules would accomplish (if C++ had modules) by writing my entire program - except for main() - inside of a class. ...
0
by: Ashish Shridharan | last post by:
Hi All I have been tryign to figure out the scope of a module as shown declared below in a web environment. My Questions are Is this module shared across multiple instances of the...
2
by: Anand Sagar | last post by:
If I declare a variable in a .vb module file , like Public Module modMain Public temp As String End Module I am able to access the variable temp in all the pages of my site. However, I want...
3
by: Chris B. | last post by:
I'm getting some strange results in an asp.net web application that has recently gone live. In the header of almost all the pages, the full name of the currently logged in user is displayed. On...
7
by: moondaddy | last post by:
I want to create a public enum that can be used throughout a project. I created an enum like this in a module: Public Enum ParentType Project = 0 Stage = 1 VIP = 2 Func = 3 Equipment = 4...
5
by: JohnR | last post by:
in VB.NET I'm trying to access my variable without resorting to SHARED scope. Here's the situation: class MYLABEL inherits LABEL and has an additional property called MYVAR. In MYLABEL I set an...
5
by: Steve | last post by:
Hi all, In a module I have the following structure.. Public Structure ButtonStatusFlags Public butOK As Boolean Public butNew As Boolean Public butView As Boolean
0
MMcCarthy
by: MMcCarthy | last post by:
We often get questions on this site that refer to the scope of variables and where and how they are declared. This tutorial is intended to cover the basics of variable scope in VBA for MS Access. For...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.