Professional Documents
Culture Documents
Creating a file-system Web site. Familiarizing yourself with Visual Web Developer. Running pages by using the Visual Studio Development Server, which lets you test ASP.NET Web pages locally and does not require IIS.
Microsoft Visual Studio 2008 or Microsoft Visual Web Developer Express. For download information, see the Visual Studio Development Center Web site.
Creating a Web Site and Page In the first part of the walkthrough, you will create an ASP.NET Web site that has a default page. This Web site will be a file-system Web site that does not require Microsoft Internet Information Services (IIS). This enables you to create and run the page from the local file system of your computer. A file-system Web site is one that stores pages and other files in a folder that you select somewhere on the local computer. Other Web-site options include a local IIS Web site, which stores the files in a subfolder of the local IIS root (typically, \Inetpub\wwwroot\). An FTP site stores files on a remote server that you access by using File Transfer Protocol (FTP). A remote site stores files on a remote server that you can access across a local network. For more information, see Walkthrough: Editing Web Sites with FTP in Visual Web Developer. Note: You can also create Web sites by using Web application projects. For more information, see Web Application Projects Overview.
1. Open Visual Web Developer. 2. In the File menu, click New Web Site. The New Web Site dialog box is displayed, as shown in the following illustration.
3. Under Visual Studio installed templates, click ASP.NET Web Site. 4. In the Location box, select the File System box, and then enter the name of the folder where you want to keep the pages of the Web site. For example, type the folder name C:\Tasks. 5. In the Language list, click Visual Basic or Visual C# to select the programming language that you will use throughout the Web project Note: In this walkthrough, you will not write any program code. 6. Click OK. Visual Web Developer creates the folder and a new page named Default.aspx. By default, when a new page is created, Visual Web Developer displays the page in Source view, where you can see the page's HTML elements. The following illustration shows a default Web page in Source view.
Examine the previous illustration and match the text to the following list, which describes the most frequently used windows and tools. (Not all windows and tools that you see are listed here, only those marked in the previous illustration.)
Toolbars. Provide commands for formatting text, finding text, and so on. Some toolbars are available only when you are working in Design view. Solution Explorer. Displays the files and folders in the Web site. Document window. Displays the documents you are working on in tabbed windows. You can switch between documents by clicking tabs. View tabs. Present different views of the same document. Design view is a nearWYSIWYG editing surface. Source view is the editor for the page that displays the markup. Split view displays both Design view and Source view for the document. You will work with Design view and Source view later in this walkthrough. If you prefer to open Web pages in Design view, on the Tools menu, click Options, select the HTML Designer node, and change the Start Pages In option. Properties window. Lets you change settings for the page, HTML elements, controls, and other objects. CSS Properties window. Displays the current CSS styles when Design view is active. Manage Styles and Apply Styles windows. Help you control the CSS styles of the Web site. Toolbox. Provides controls and HTML elements that you can drag onto a page. Toolbox elements are grouped by common function. Database Explorer. Displays database connections. If you do not see the Database Explorer window in Visual Web Developer, on the View menu, click Other Windows, and then click Database Explorer. Note: The Database Explorer window in Visual Web Developer is named Server Explorer in the full version of Visual Studio.
You can rearrange, resize, and dock the windows to suit your preferences. The View menu enables you to display additional windows.
The Toolbox window is displayed. 13. In Design view, from the Standard tab of the Toolbox, drag a Button control to the document and drop it in the div element. Notice that Source view is updated with the appropriate markup. 14. On the View menu, click Database Explorer. The Database Explorer window is displayed. Note: The Database Explorer window in Visual Web Developer is named Server Explorer in the full version of Visual Studio. 15. Right-click Data Connections to see the available database options.
8. Click Add. Visual Web Developer creates the new page. By default, the page is displayed in Source view.
1. Press CTRL+F5 to run the page. Visual Web Developer starts the Visual Studio Development Server. An icon appears on the Windows toolbar to indicate that the Visual Web Developer Web server is running, as shown in the following illustration:
The page is displayed in the browser. Although the page you created has an extension of .aspx, it currently runs like any HTML page. Note: If the browser displays a 502 error or an error that indicates that the page cannot be displayed, you might have to configure your browser to bypass proxy servers for local requests. For details, see How to: Bypass a Proxy Server for Local Web Requests. 2. Close the browser. Next Steps