Adding the Admin folder and a page

Learning Resources
 

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

  1. 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.

  2. 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

  1. In Solution Explorer, right-click the AdminPages folder and select Add New Item.

  2. Select a Web Form, and in the Name box, enter Admin.aspx. Select the Select master page box, and then click Add.

  3. In the Select a Master Page dialog box, under Contents of folder, select Site.master, and then click OK.

  4. 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.

  5. In the Formatting toolbar, use the Block Format drop-down list to format the text as Heading 1.

  6. Save and close the Admin.aspx page.

  7. Right-click the MembersPages folder and select Add New Item.

  8. Add a second Web Form page, name it Members.aspx, and select Site.master as its master page.

  9. Switch to Design view, add text such as Welcome to the Members page, and style it as a heading.

  10. Save and close the Members.aspx page.

  11. Open the Default.aspx page and switch to Design view.

  12. Add text such as Welcome to my home page. page.

  13. Save and close the Default.aspx page.

  14. Open the Site.master page.

  15. Switch to Design view and change the heading of the Site.master to a heading such as My Roles Web site.

--Microsoft
 For Support