Creating the Web Application's files

At this stage I have a top level folder called rras containing a home page called default.aspx and six sub-folders.

We now need to create some pages within our application so:

1. Using the workspace area of Web Matrix select our “pages” folder so that this folder is highlighted.
2. Moving to the menu at the top of the workspace select the “New File” icon which is second from the left in the menu.
3. Clicking on the “New File” icon will open the “Add New File” dialog box (Figure 4).
4. If it’s not already selected under templates select “General” and on the right hand side select “ASP.Net Page”.
5. The location at which the file will be created should be shown in the “Location” box; this will already be selected and will be greyed out as you have already specified this location in 1 above.
6. Now change the name of the file in the “Filename” box to the name of your new file (I will use default.aspx) and check that Visual Basic .Net is selected next to language as this is the language in which we will be working.
7. Once you are happy that all the settings have been entered correctly click on “OK” and the Web Matrix will create your first ASP.Net web page and put it into the folder that you have specified above. The page will be open in the editor ready for you to start working with it.

Add new file Web Matrix
Figure 4

Note that I have chosen to name my first file in this new folder default.aspx. If a user attempts to browse this folder without first specifying a file name then this default page will be served to the user. The web server will always serve up a default page if available when the file name is not specified in a URL request. This will prevent the HTTP error 403 “You are not authorised to view this page” message from being displayed after a user attempts to access a folder without specifying a file name. You may decide to make this page one of your planned pages or use it to redirect the user to an appropriate location within web application, perhaps your site map.

Now create the remaining pages by repeating the process above making sure that each of the required pages is created in the correct folder. Don’t forget that you may choose to create at least a default.aspx in every folder.

You can also create new pages by selecting the appropriate folder and using the right mouse button to select “New File” from the list of options. This will open the “Add New File” dialog box as in Point 3 above.

Note also that should you wish to remove a page at any time, a page can be deleted by selecting the page and then clicking on the “Delete” icon from the menu at the top of the workspace which is fourth from the left in the menu. You can also delete pages by selecting them and using the right mouse button select “Delete” from the list of options.

Finally add a style sheet to your styles folder by following the steps in 1 to 7 above to create a new file but on this occasion ensure that you select “Style Sheet” in step 4.

Once you have created all the folders and files that you need you should be able to view your new application structure in the Workspace. My project is shown fully expanded in Figure 5.

Workspace file Web Matrix
Figure 5

<<Creating web applications folders

Get the best asp hosting provider from web-hosting-top.com and save up to 30%

Advertisements



MembersPro

MembersPro PayPal - ASP Membership software

Plug and play ASP membership script that integrates with PayPal to let you charge recurring membership fees.

Global ASP.NET Hosting Leader - Click Here