I'm using jquery to access a asp.net web service from my website. This web service needs to get the userid of the user that access it and the user is logged in with asp.net authentication on my website.
In asp.net I can just write "User.Identity.Name" to get the userid, now I need to find a way of getting this on the client side, how is that possible?
My code for accessing the web service:
$.ajax({
type: "GET",
url: "http://domain.com/Service.svc/search?keyword=" + this.value + "&userid=" + HERE I NEED THE USERID,
dataType: "json"
.....
});
One way would be to put the userid in a hidden field or something and access it that way, could that be the way to go?