Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Nov 14, 2012 06:40 PM by DotNetTim
Nov 08, 2012 06:07 PM|LINK
I have an app I'm building in which I'll be using a database to display items from a Diner Menu. The menu needs to be updatable by the owners. So, I want to use web pages for this and that's no problem, but I'd like to be able to put the ability to update,
delete, and revise the pages in a folder under the root and then have the owners login. Is this possible and are there any links that explain this well?
I noticed in the Starter kit there's a login feature, but it looks like it's used for all of the pages? I'm new to this and haven't had the chance to really dig in, so I thought I'd ask what's the best approach and wondering what you folks would recommend?
Should I use the Appstart?
Nov 08, 2012 08:46 PM|LINK
You can find out how to use security from these tutorials: http://www.asp.net/web-pages/tutorials/security
Nov 09, 2012 10:16 AM|LINK
You can give 'Admin' role to the owners. Put your files which you need to protect in the Admin folder.
(For that, you need 2 tables in database. 'CreateRole' is to create roles, 'AddUsersToRoles' is to add users to roles.)
Create a '_PageStart' file and write the following code:
As you can understand from the code that the users who do not have 'Admin' role, will be directed to the Default page.
Nov 12, 2012 02:48 PM|LINK
For ASP.NET a logged in user dont more likely to be like Afzaal Ahmad Zeeshan its like WebSecurity
WebSecurity.IsAuthenticated is used to tell the pages and server that the user is logged in. Its done only when you log in through a login page the admin provides. Now you have to check whether user is logged one or just a robot. You can use an if..else
// Redirect them to somewhere else. Or change the form content. bla bla what ever..
This will be done when the user is not logged in. You can make a login page. And in the block you can write it as
I considered your login page to be available at this url.
Nov 14, 2012 06:40 PM|LINK
Thanks everyone. I found the examples after I asked, and I apologize for that. I appreicate the answers.