views:

60

answers:

3

Hi All,

I am developing a small application in asp.net (writing in c#). In my application I am using jquery to perform asynchronous call to the server. I have an http handler that listens in to the requests and does what it needs to do.

Problems start when in the handler I need to access information stored in the page , from where the asynchronous call started. When I try this:

 Page page = HttpContext.Current.Handler as Page;

I don't get a page.

How else can I access the page itself?

Thank you

A: 

You can create new instance of page.

SomePage page = new SomePage();
iburlakov
You are barking up the wrong tree here. This might get you a Page class, but it will have nothing to do with the Request being handled.
Bryan
Absolutely agree with you Bryan. But it answers the question.
iburlakov
A: 

@vondip please give us more details wat yuo are doing. What kind of data stored in the page you want to access .

Mukesh
+3  A: 

You have a slight design issue. The Page class IS an HttpHandler. It is in fact the default HttpHandler that handles requests. When you define your own HttpHandler, there is no Page class... and hence no Master either.

If you need to access information from a different page, you need to do that via the normal ASP.NET mechanisms... Session, Cache, etc.

Bryan