0

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.

1 Answer 1

1

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)

Sign up to request clarification or add additional context in comments.

3 Comments

Ohk I ll check it out. May be this will help, I think I can access session in web method also. Thanks.
I have tried to pass session from asp.net application to the service, but not get lucky till now... I found another way, using cookie container. I was working on that only. Once completed will post here. Thanks for the reply.
did yiu try to access the session like this: (HttpContext.Current.Session)?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.