Hi folks... first of all thanks for replying.... thanks a lot
To Harrish, as u mentioned "Allow Anonymous Access" checkbox should be checked", which shouldnt be, bcoz if To Anonymous Access is checked(on), then IIS wont even bother for username or any credantials from which the web page is being requested and the output for the user.Identity.Name will be NULL string only. I have already tried it and it is returning Null string, so by either a way, "Allow Anonymous Access" should be checked off or by using web.config <authorization> <deny users="?"/> </authorization>... I have to disable the Anonymous access.
To Jae,
I am basically using this code Visible='<%# Page.User.IsInRole("DOMAINNAME\\USERNAME") %>' in a one button in each page and also using Page.User.Identity.Name concept in my master page. so to keep that two things on working, I have to disable the anonymous access and enable Windows authentication. I tried using all below different configuration in web.config:
(1) Anonymous Access Box checked off(disabled)
<
compilation debug="true"/>
<
authentication mode="Windows"/>
<
authorization>
<allow users="*" />
</
authorization>
(2) Anonymous Access Box checked on(enabled) [NOTE: but still I am disabling it by below web.config]
<
compilation debug="true"/>
<
authentication mode="Windows"/>
<
authorization>
<deny users="?" />
</authorization>
<identity impersonate="true" />
I think this would help you guys in better way to solve this issue....
Once again thanks a lot for your previous reply and time.
work smarter, Not Harder.
Bhavesh Patel