473,406 Members | 2,312 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,406 software developers and data experts.

Determine Calling Context

I'm developing a middle tier business object that can be called from either a
Windows Form or Web Form front-end. Is there a way to detemine the context of
the call to determine if the call is coming from an http request or a window
call?
Jul 21 '05 #1
3 1352
David,

Pass a boolean for that.

Just my thought,

Cor
Jul 21 '05 #2
Simple, but I was looking for something a little more behind the scenes. This
is especially true as you get deeper into a library. You don't want to have
keep passing around a boolean to all your layers just to know the calling
context. The only solution that I could come up with is to test if the
HttpContext.Current is set to nothing or not. If is nothing, then I assume
that I am running under Windows. If is has a value, I assume that I am
running under APS.NET. I just don't know if this realiable or not. I've been
searching for a WindowsContext object or similiar object that is only present
when the caller if coming from a Window's client.
"Cor Ligthert" wrote:
David,

Pass a boolean for that.

Just my thought,

Cor

Jul 21 '05 #3
DavidM,
Simple, but I was looking for something a little more behind the scenes.
This
is especially true as you get deeper into a library. You don't want to
have
keep passing around a boolean to all your layers just to know the calling
context. The only solution that I could come up with is to test if the
HttpContext.Current is set to nothing or not. If is nothing, then I assume
that I am running under Windows. If is has a value, I assume that I am
running under APS.NET. I just don't know if this realiable or not. I've
been
searching for a WindowsContext object or similiar object that is only
present
when the caller if coming from a Window's client.

When you don't want to pass information, however use information in the
system, than you can in my opinion forget all you did by creating tiers. You
make your classes completly depending from other ones and not from the
information that is given to them.

However just my idea.

Cor
Jul 21 '05 #4

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

Similar topics

3
by: mikeorb | last post by:
Is there a way to determine the object that a property is in? For example: function MyClass() { ... } MyClass.prototype.myFunc = function() { ... } var obj = new MyClass(); var sameobj =...
31
by: bilbothebagginsbab5 AT freenet DOT de | last post by:
Hello, hello. So. I've read what I could find on google(groups) for this, also the faq of comp.lang.c. But still I do not understand why there is not standard method to "(...) query the...
0
by: John Baro | last post by:
I have a number of pictureboxes that I create dynamically and add a context menu for (One context menu for all of them). Is there any way to determine which control the context menu was invoked...
6
by: Arsen V. | last post by:
Hello, I have a localization class that I want to use from either Web or Windows Forms apps. Currently it stores some information in the HttpRuntime.Cache object. I want to be able to determine...
1
by: Bucky Pollard | last post by:
I have a web service that needs to create a batch file and call it (since there are no APIs for the functionality I am looking for). I am using the Process and ProcessStartInfo objects. When I try...
3
by: mnet123 | last post by:
I am using "Server.Transfer()" to send data to an ASP.NET page that's sole purpose is to display messages. I am using "Server.Transfer since I can set the contents of the message I want to display...
3
by: Danny Miller | last post by:
Hi there, I've got a web app that uses impersonation and makes calls to a SQL Server backend. I'd like to be able to automate the setting of database security for the web app upon deployment....
3
by: DavidM | last post by:
I'm developing a middle tier business object that can be called from either a Windows Form or Web Form front-end. Is there a way to detemine the context of the call to determine if the call is...
0
by: Przemysław Bana¶ | last post by:
Hello! Can anyone help me with calling Novell function from dll? I think my main problem is in translating C variable types to C# types. Here is the code: using System; using...
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
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
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,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.