473,545 Members | 2,092 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hooking into Application objects

I am trying to write a static utility class that allows me to modify
Application variables in my web application.

My problem is that I cannot figure out what to import or inherit to
allow me to see application objects or even the server object.

Here is my code:

Public Shared RefreshCachedXM LDatasets()

Dim dsLinks As New DataSet()
'-- Cached XML Menu
dsLinks = New DataSet()
dsLinks.ReadXml (Server.MapPath (Utilities.GetC onfigValue("XML MenuFilename",
"")))
Application("CA CHED_XML_MENU") = dsLinks

'-- Cached Portfolio
dsLinks = New DataSet()
dsLinks.ReadXml (Server.MapPath (Utilities.GetC onfigValue("XML PortfolioFilena me",
"")))
Application("CA CHED_XML_PORTFO LIO") = dsLinks
End Sub

The application object or server object do not exsist.
Any Suggestions?
Nov 20 '05 #1
2 1118
Hi Brian,

I would suggest implementing this class as an amended singleton. It would
have an Initialize method creating the sole instance which would accept the
Application object as the argument. This method would be called upon
Application_OnS tart. Then, it would have the standard singleton Instance
property to access the sole instance. This instance will have been
pre-initialized with a reference to the application object by the moment you
will be accessing it for the first time.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Brian Bender" <br***********@ hotmail.com> wrote in message
news:b7******** *************** ***@posting.goo gle.com...
I am trying to write a static utility class that allows me to modify
Application variables in my web application.

My problem is that I cannot figure out what to import or inherit to
allow me to see application objects or even the server object.

Here is my code:

Public Shared RefreshCachedXM LDatasets()

Dim dsLinks As New DataSet()
'-- Cached XML Menu
dsLinks = New DataSet()
dsLinks.ReadXml (Server.MapPath (Utilities.GetC onfigValue("XML MenuFilename", "")))
Application("CA CHED_XML_MENU") = dsLinks

'-- Cached Portfolio
dsLinks = New DataSet()
dsLinks.ReadXml (Server.MapPath (Utilities.GetC onfigValue("XML PortfolioFilena m
e", "")))
Application("CA CHED_XML_PORTFO LIO") = dsLinks
End Sub

The application object or server object do not exsist.
Any Suggestions?


Nov 20 '05 #2
Dmitriy,

I uderstand what you are saying. i am familiar with singleton. However
isn't there a built in way to do this. All webforms are classes and
they see these objects. How do they do it? It has got to be some type
of import or inheritance.
Nov 20 '05 #3

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

Similar topics

1
5343
by: Matthew Kelly | last post by:
I have pulled together a VB.net project that hooks the keyboard (Ref. Paul Kimmel's hooking program) and allow the user to send "mouse right clicks" via the SendInpuut function (mouse emulation works fine). I am also trying to make this project capable of "Rearrange the keyboard" (example type "e" and "K" is sent to the application) by using...
1
710
by: Matthew Kelly | last post by:
I have pulled together a VB.net project that hooks the keyboard (Ref. Paul Kimmel's hooking program) and allow the user to send "mouse right clicks" via the SendInpuut function (mouse emulation works fine). I am also trying to make this project capable of "Rearrange the keyboard" (example type "e" and "K" is sent to the application) by using...
5
2009
by: Ryan Ginstrom | last post by:
Apropos recent threads about GUI editors, coming from a Win32/WTL C++ background, I actually like the idea of being able to (easily) create GUIs programmatically. But I still see a lot of the same tedium: hooking up events to handlers, and getting data into and out of dialogs. In C++, this is generally handled through code generation and/or...
8
1955
by: pigeonrandle | last post by:
Hi, Has anyone had any experience with hooking messages in other application windows (like SPY++). I want to listen for WM_MOVE messages, but can only seem to find examples of Keyboard and Mouse hooks. Please (and thankyou), James Randle.
0
7473
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, 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...
0
7661
Oralloy
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. ...
0
7815
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
5976
agi2029
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...
1
5340
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3458
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...
0
3444
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1891
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
712
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.