Last post Jun 03, 2013 11:36 AM by JT12
May 17, 2013 11:48 AM|JT12|LINK
I enabled Windows Authentication for a Web Pages site like explained here: http://www.mikepope.com/blog/AddComment.aspx?blogid=2298
Is it possible to restrict or allow access to certain pages based upon username or user group?
May 17, 2013 02:07 PM|wavemaster|LINK
Put this at the top of the page inside the code brackets.WebSecurity.RequireRoles("youruserrolehere");
May 17, 2013 02:23 PM|JT12|LINK
Thanks for the reply.
When I tried that, I got this message.
To call this method, the "Membership.Provider" property must be an instance of "ExtendedMembershipProvider".
May 17, 2013 04:59 PM|yousaid|LINK
looks like you have not created roles. Open your database and verify that you have these three tables:
Then verify that they are NOT empty. Finally, open your web.cofig file and verify that Windows Authentication is set to "Enabled".
<windowsAuthentication enabled="true" />
hope this helps
May 18, 2013 03:41 AM|GmGregori|LINK
I enabled Windows Authentication
I have no experience with Windows Authentication but maybe this article could help:
How To: Use Windows Authentication in ASP.NET 2.0.
Jun 03, 2013 11:36 AM|JT12|LINK
Hi Everyone and thanks for the suggestions. I'm sorry that I took so long to follow up.
Here is what I decided to do with help from this link provided by GmGregori: http://msdn.microsoft.com/en-us/library/ff647405.aspx.
It seems to get the job done.
In _PageStart file or in the file of your choosing:
// Perform restricted operation