Adding the Admin folder and a page
It is accomplished by creating a new directory in solution explorer called administrator and adding an ASP .Net master page.
To create folders for restricted access
- In Solution Explorer, right-click the root of your Web site, click New Folder, and then name the folder AdminPages.This folder will contain a page that is accessible to only users who are assigned to the Admin role. You will create roles later in the walkthrough.
- Right-click the root of your Web site, click New Folder, and then name the folder MembersPages.This folder will contain a page that is accessible to all users who are logged in.
To add pages to the folders
- In Solution Explorer, right-click the AdminPages folder and select Add New Item.
- Select a Web Form, and in the Name box, enter Admin.aspx. Select the Select master page box, and then click Add.
- In the Select a Master Page dialog box, under Contents of folder, select Site.master, and then click OK.
- Switch to Design view and add text such as Welcome to the administrators page. The exact text is not important. You can add any text that lets you identify the page.
- In the Formatting toolbar, use the Block Format drop-down list to format the text as Heading 1.
- Save and close the Admin.aspx page.
- Right-click the MembersPages folder and select Add New Item.
- Add a second Web Form page, name it Members.aspx, and select Site.master as its master page.
- Switch to Design view, add text such as Welcome to the Members page, and style it as a heading.
- Save and close the Members.aspx page.
- Open the Default.aspx page and switch to Design view.
- Add text such as Welcome to my home page. page.
- Save and close the Default.aspx page.
- Open the Site.master page.
- Switch to Design view and change the heading of the Site.master to a heading such as My Roles Web site.