Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
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…
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

932 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

22 Experts available now in Live!

Get 1:1 Help Now