Hi, i would like to know if there is a way to differentiate between
requests, someting like a number that is unique only in the execution of
an individual request.
Thank you
Pietro 8 1289
If you mean from different sessions/browsers/etc... sure
If you mean from the same user in the same session.. not really. You could
easily tie in an unique id (time perhaps).... but more to the point.. what is
the end goal you are after? What's the problem that lead you to this?
--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
"Pietro" wrote: Hi, i would like to know if there is a way to differentiate between requests, someting like a number that is unique only in the execution of an individual request.
Thank you Pietro
No.
You can attach a unique identifier (e.g. a guid) to the request in the
Application_Beg inRequest if you need it (sometimes useful for audit
purposes), e.g
HttpContext.Cur rent.Items["ReqID"] = new GUID();
Ex: My page has several controls, there is 2 users acessing this page, i
want the controls to share data in a commum place, like a static class,
but data from one user cannot be acesseable by other user, and i don´t
need the data avaliable between requests, it will last only in current
request.
Thanks
Pietro
Curt_C [MVP] wrote: If you mean from different sessions/browsers/etc... sure If you mean from the same user in the same session.. not really. You could easily tie in an unique id (time perhaps).... but more to the point.. what is the end goal you are after? What's the problem that lead you to this?
Thanks, i will test it.
Pietro
Stefan wrote: No.
You can attach a unique identifier (e.g. a guid) to the request in the Application_Beg inRequest if you need it (sometimes useful for audit purposes), e.g
HttpContext.Cur rent.Items["ReqID"] = new GUID();
I think the code below should be:
HttpContext.Cur rent.Items["ReqID"] = Guid.NewGuid(). ToString();
John
-----Original Message-----
From: Stefan [mailto:Cl****** ***@gmail.com]
Posted At: Wednesday, August 31, 2005 12:39 PM
Posted To: microsoft.publi c.dotnet.framew ork.aspnet
Conversation: differentiating between requests
Subject: Re: differentiating between requests
No.
You can attach a unique identifier (e.g. a guid) to the request in the
Application_Beg inRequest if you need it (sometimes useful for audit
purposes), e.g
HttpContext.Cur rent.Items["ReqID"] = new GUID();
Sounds like you want your state to be stored in
HttpContext.Cur rent.Items
(Each of your users has a different context and the lifecycle of
Context.Items
is the begins and ends with the request).
Alternatively, you can also use a ThreadStatic for this (although there
is a common
misconception that ThreadStatic cannot be used in asp.net because the
worker
threads are reused, but in fact it is quite easy. So, if you want to
access this data
outside your asp.net web layer (model/data access) a threadstatic might
be the
more "architecturall y" elegant solution (since you do not have to
import System.Web namespace):
Use static members for the shared data, and instance members for the
user-specific...
HTH,
Paul
"Pietro" wrote: Ex: My page has several controls, there is 2 users acessing this page, i want the controls to share data in a commum place, like a static class, but data from one user cannot be acesseable by other user, and i don´t need the data avaliable between requests, it will last only in current request.
Thanks Pietro
Curt_C [MVP] wrote: If you mean from different sessions/browsers/etc... sure If you mean from the same user in the same session.. not really. You could easily tie in an unique id (time perhaps).... but more to the point.. what is the end goal you are after? What's the problem that lead you to this? This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Fakhar |
last post by:
Hi All,
How can I check fake requests on my webpage. I am asking for email address
as input and I wounder if anyone write a program to send fake requests and
my system will be busy to respond those requests.
Specifically, I want to check if more than 10 requests from same IP in last
One minute then my Website should not respond to that IP.
Take care
|
by: Ohaya |
last post by:
Hi,
I'm trying to understand a situation where ASP seems to be "blocking" of
"queuing" requests. This is on a Win2K Advanced Server, with IIS5.
I've seen some posts (e.g.,
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=Tidy7IDbDHA.2108%40cpmsftngxa06.phx.gbl)
that indicate that ASP will queue up requests when they come in with the
same "session".
|
by: Peter Jaffe |
last post by:
I've seen a few posts on this topic, but still haven't found a clean
solution. Anyone have other suggestions or feel that one of the
options I highlight below is the way to go?
The Problem
-----------
A sequence of user interactions span multiple ASP.NET http POST
PostBacks within the same page. There is a need to be able to
identify each step of the interaction at the web server level (using a
log analyzer such as WebTrends). ...
|
by: Tony |
last post by:
I've done a fair bit of searching on this, but I want to be certain
about what I've found - so here goes with a long example and three
questions:
For clarity, let me give an example (a number of the pages I found had
some ambiguity). Say I have a page with 2 buttons ( A and B, for
simplicity) and each button will make a different "ajax" request, for
data to be placed in a corresponding DIV.
For sake of example, we won't consider...
|
by: rzimerman |
last post by:
I'm hoping to write a program that will read any number of urls from
stdin (1 per line), download them, and process them. So far my script
(below) works well for small numbers of urls. However, it does not
scale to more than 200 urls or so, because it issues HTTP requests for
all of the urls simultaneously, and terminates after 25 seconds.
Ideally, I'd like this script to download at most 50 pages in parallel,
and to time out if and only...
| |
by: Michael Schwarz |
last post by:
Hi,
I have a problem where I have two requests (i.e. two different windows that
are using the same session) that are accessing the session collection. The
requests will need more time on the server, but I get the problem that the
two sessions are not getting updated values from each requests. Is this by
design or is there any solution to do this?
--
Best regards | Schöne Grüße
|
by: linda.chen |
last post by:
Hi all,
We have a webservice (service1), which calls another
webservice(service2) from another orginization. Our end users make
requests throught service1. When service2 receives a quest, it puts
all the request information into a database. The request will be
picked up from a sheduler which is installed in 8 different servers.
The response is very slow if we have many requests.
|
by: =?Utf-8?B?Vkg=?= |
last post by:
Hi, all.
Need help with what seems to be either connection, or threading problem in
my ASP.NET 2.0 application.
The gist of the problem is this: IHttpHandler in my application serves an
HTML page that has two images (image A and image B) in it. Once the HTML page
is served, expected behavior is this:
1) receive request for image A,
2) receive request for image B almost at the same time as for A,
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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 captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
| |
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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 launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |