http://jquery.com/ provides great controls. And also there are many other opensource control based on Jquery. But now control like Auto-complete , one need to use web service to get data and bind with control using jquery. I am able to bind data successfully. But now I want that, only authenticate user can see or use that data. Its quite possible using network credential class, but that is only when I am writing server side code or we can say consuming service at server side or using it in windows application. But I don’t know how to do this with JavaScript / Jquery. In Asp.Net MVC it is a functionality to POST data, but I don’t know if we have anything like this in Asp.Net web forms(.net 4.0).
Please help me out with this. Example or sample code will be highly appreciable.
Thanks in advance.
The auto complete (or similar) is making a call to handler that is running under your domain so all the things that are available to in any other page (session, cookie, context) are also available in your handler so you can simply check if the user is authenticated in you handler and decide what to do if he isn’t.
In Web Method you can access the session like this:
(HttpContext.Current.Session)