Solved

ASP.NET Getting the Current Page's Control from a Static Member

Posted on 2011-09-22
2
263 Views
Last Modified: 2012-08-13
I am running ASP.NET 3.5.  I am trying to use AJAX calls using JQuery, so I am making some non-static methods static so that I can call them through AJAX. One of them updates a drop-down list box on the client's current page.  My understanding is that I would now first need to get the current page object from my static method and then get the control I need to update.  The question is how can I get the current web page?  I tried getting the page trhough HttpContext.Current.CurrentHandler and got null - since I am running a static method, perhaps this is expected?

The question is how I can get the current web page object from a static method?
Thank you.


   
0
Comment
Question by:Mare22
  • 2
2 Comments
 
LVL 12

Accepted Solution

by:
jagssidurala earned 500 total points
ID: 36582682
you need pass a parameter to your ajax webmethod in jquery call as we can not access controls in ajax page methods
0
 
LVL 12

Assisted Solution

by:jagssidurala
jagssidurala earned 500 total points
ID: 36582730
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now