Solved

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

Posted on 2011-09-22
2
266 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

809 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