0

I am trying to personalize equipment placement maps in google maps by customer. Is there a way to access a property from the membership class(asp.net id?) via jquery?

dinotom
  • 4,990
  • 16
  • 71
  • 139

2 Answers2

0

Yes you can use http handler and you can get anything from there.
You can use IRequiresSessionState to use access session.
More Detail:
How can I use Session variable in an HttpHandler

Helpful links to call httphandler from jquery
http://www.codeproject.com/Articles/203621/Call-HTTPhandler-from-jQuery-Pass-data-and-retriev
passing parameter to Http Handler from jQuery call

Community
  • 1
  • 1
शेखर
  • 17,412
  • 13
  • 61
  • 117
0

You have several choices:

  1. Access the current user is by writing it to the response. Something like (JavaScript):

    var userid = '<%=HttpContext.Current.User.Identity.Name%>';
    
  2. Make an ajax request to a web method (either to a Page Methods/Web Service or an HTTP Handler) that returns the current user id. Something like

    $.post("SomeURL/GetUserID",function(data){  });
    

Full examples here: http://encosia.com/using-jquery-to-directly-call-aspnet-ajax-page-methods/

Icarus
  • 63,293
  • 14
  • 100
  • 115