views:

286

answers:

2

Using jQuery, my client side is calling Vote from a page method. The signature of the webmethod is below.


    [WebMethod]
    public static string Vote(int selectedAnswer, int pollID, string userToken) {
    ... }

My question is in Vote(), how do I reference Page.Request so I can get the user's IP Address? In a normal page load method, I'm able to reference Page.Request because the page load method is NOT static, where Vote is.

+3  A: 

You should be able to get it using: System.Web.HttpContext.Current

As the name implies HttpContext.Current gets the current HTTP context. You can get the Request object from the current context and go from there.

James Conigliaro
A: 

some question here from me

Get IP Address of the requested client soap message

hope it helps...

balexandre