Last post Oct 23, 2017 08:05 AM by Cathy Zou
Oct 22, 2017 02:40 PM|Chetan Navale|LINK
I am creating a ASP.NET web form application in .Net framework 4.6. The code behind used is C#. I have multiple pages in the application, but according to the requirement, there will be one page called "Report.aspx" which should be accessible only to restricted
users. All the other pages should be accessible to everyone.
So we will be keeping anonymous access in IIS to the application folder. Now the issue is I don't understand how to create a login page for only single page inside the application which will be triggered if the Report page will be triggered.
Can someone kindly provide an idea or any link which can be referred to perform this action. I will be quite thankful if someone can provide the ideal code to perform this implementation. Kindly let me know if any additional details are necessary.
Thanks in advance!
Oct 22, 2017 02:50 PM|mgebhard|LINK
There is no difference between creating a login and role to protect a single page or multiple pages. Simply place the Report.aspx inside a folder protected by a web.config. Create a login page and user backing store to handle the login.
Oct 23, 2017 08:05 AM|Cathy Zou|LINK
Hi Chetan Navale,
For your problem, as mgebhard mentioned, you should implement Form authentication in your application.
Then setting authorization rules for a particular page or folder in web.config