Following was my response to that:
check that if the current user is authenticated or not. u may try this if block:if(this.Context.User.Identity.IsAuthenticated)
and if u come to know that the user is not authenticated (which i am sure u will find) then this means that like most of us u have enabled anonymous access. try disabling it and then run ur code by selecting windows authentication mode in your directory security settings in IIS.
2 comments:
hi really ur answer is wonderful. You have saved a lot of time for me..
Thanks
Rahul.
Do u mean to say that if I do Anonymous access ; every time the Context.User.Identity.IsAuthenticated wil be false ? ..
If this is so then how come the web-page is being accessed ?
Botton line is that is IsAuthenticated is false then the uses shoud not be allowed to access the page. ( in context of Anonymous access enabled)
Ankit
ankitbhurat@gmail.com
Post a Comment