Planning your structure with Visual Studio

To complete the same steps in Visual Studio is a fairly similar process to that explained above. First open Visual Studio by either double clicking the icon on your desktop, single clicking the icon in your quick launch bar or selecting the program from your list of programs from the start menu. When Visual Studio opens you will be presented with the Start Page in the main viewing area and you may see the Toolbox, Solution Explorer or Server Explorer along either of the sides. As these are fully dockable within Visual Studio they may appear in a variety of locations and can be moved by dragging them around the working environment.

Similar to Web Matrix, the Toolbox is used for dragging various controls onto your web forms which will save you some typing time. The Solution Explorer takes the place of the Workspace and provides you with a full view of your Solution along with any projects and files that it contains. (Note that when working with Visual Studio each Solution may have more than one Project.) The Server Explorer provides you with the same information as the Data Tab in Web Matrix although the abilities of Server Explorer extend far beyond those of the Data Tab.

The start page has a number of tabs, one of which is the projects tab. The projects tab lists those projects that you have recently worked on. (Note that this feature appears to be somewhat unpredictable and I am aware of several developers whose Visual Studio may or may not update this list correctly.) If you created a new project during our last tutorial you should see this listed on the page. You can open this project now by clicking the name of the project from the list on this page. If you can’t see the Start page or your project is not on the list then you can open it by clicking on “File”, “Open” and then “Project” from the File Menu. You should then be able to select your project folder and the solution file from within this folder to open the project. Once you have your project open, if the start page is still open you can close it by clicking on the “x” on the top right hand corner of the page.

Make sure that the Solution Explorer is in view so that you can work with your project (Figure 6). I normally drag my tools to the right hand side so that they don’t interfere with any code that I am writing in the main workspace area. (Note that as the code is written from left to right, many of these boxes are prone to pop out from the side and may conceal the code that you are working on). You will note that within Solution Explorer you are able to view a number of files that have already been created for you by Visual Studio. These will include AssemblyInfo.vb, Global.asax and Web.config but also WebForm1.aspx. You may have already renamed this to defaut.aspx or deleted it during our last tutorial.

AssemblyInfo.vb contains information about the project which is used during compilation and can be safely ignored for the time being. The Global.asax file stores data about the way in which the application works such as any actions required at start up and the Web.config can be used to configure behaviour in the application such as how error messages are displayed. We will delve deeper into these files in later tutorials. Any of these files can be opened by double clicking on their name within the Solution Explorer.

Solution Explorer Visual Studio
Figure 6

<<Creating web applications files

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