Developing a Web Project with Microsoft Visual C# 2010
- By John Paul Mueller
After completing this chapter, you’ll be able to:
Start Visual Web Developer 2010 Express so you can build web applications with it
Create a standard project without writing any code
Create a standard website without writing any code
DESKTOP APPLICATIONS ARE STILL THE primary way that businesses interact with data—but a vast array of other options are available. One increasingly common choice relies on the Internet (or an intranet) to host various kinds of applications. This book won’t show you every kind of application you can create in Visual Studio, but it does provide an overview of how to build the more popular types.
Most applications begin with the need to access some type of data from a client application. The client-server paradigm has been around for many years in a number of forms. These Internet applications are just another form.
For more information, see “client-server” in the accompanying Start Here! Fundamentals of Microsoft .NET Programming book. To obtain your copy, see the section titled “Free Companion eBook” in the introduction to this book, or turn to the instruction page at the back of the book.
This chapter begins by exploring the tool you use to create web applications of various types: Visual Web Developer 2010 Express. The applications you will focus on first are intended for the client. Knowing how to create a user interface for any sort of data is helpful, even data hosted by someone else. In fact, with the incredible stores of data available online, it’s a wonder that people still find something new to store—but they do. Visual Web Developer 2010 Express can help you create most of the client application types that the .NET Framework supports.
After you get to know Visual Web Developer 2010 Express a little better, you’ll begin working with some actual applications, creating a simple project, and using it to define a simple web application. The second project shows you how to create a simple website and access it using a browser. These two application types go a long way toward getting you started programming the Internet, but of course, they’re just the beginning. Other chapters in this book explore web applications in considerably more detail.
Starting Visual Web Developer 2010 Express
After you have Visual Web Developer 2010 Express installed on your system, follow these steps to start the Integrated Development Environment (IDE) (which is different from the Visual C# 2010 Express product used in Chapter 1): choose Start | All Programs | Microsoft Visual Studio 2010 Express | Microsoft Visual Web Developer 2010 Express. You’ll see the IDE start up, as shown in Figure 2-1.
Figure 2-1 The Visual Web Developer IDE opens with the Start Page.
The IDE begins by displaying the Start Page. You can turn this feature off by clearing the Show Page On Startup option in the lower-left corner. If you later decide you want to see the Start Page, choose View | Start Page and select the Show Page On Startup option again. The Close Page After Project Load option works for both projects and websites. It frees up screen real estate by closing the Start Page when it’s no longer needed after you create or open a project or website.
The left side of the Start Page also contains links for creating or opening a project or website. The “Understanding the Difference Between Websites and Projects” section of this chapter describes the differences between a project and website, so don’t worry about it for now.
Anything you’ve worked on recently (both projects and websites) appears in the Recent Projects list. Click the entry for the project or website you want to open. If you’re using Windows 7, remember that you also have access to the Jump Lists feature by right-clicking the Microsoft Visual Web Developer 2010 Express entry in the Start menu, and choosing the project or website you want to open.
On the right side of the display, the Get Started tab contains a number of interesting entries. These entries are all devoted to helping you become more productive with Visual Web Developer 2010 Express quickly. They’re also different from the Visual C# 2010 Express offerings. Here are the four Get Started topics and why you should look at them:
Get Started with ASP.NET and Visual Web Developer Express This option doesn’t display help information—you get help by pressing F1. Instead, the first link for this entry provides access to videos and tutorials you can use to learn more about Visual Web Developer. The second link provides access to the Active Server Page (ASP).NET forums where you can ask questions of other developers and various experts that roam the forums.
Explore Free Open Source Applications Click the link for this option to see open source applications at http://www.microsoft.com/web/gallery/. When you get to the site, you’ll see a number of free applications. You can select an application and click Install to download and automatically install the application to your hard drive so that you can use it. For example, you’ll find a number of interesting Content Management Systems (CMSs), such as Joomla and DotNetNuke. It pays to spend some time browsing this site even if you don’t end up downloading anything, because looking at the range of available applications can provide useful ideas for your own applications.
Find Affordable Web Hosting Click this link to find a number of affordable web hosting companies at http://www.microsoft.com/web/hosting/home. Each company offers different features at different rates, so you’re likely to find a solution that meets your needs.
Get More Software at No Cost This section contains a number of links for free software. For example, if you click the Microsoft DreamSpark for Students link, you’ll go to http://www.microsoft.com/web/hosting/home, where you can find out more about this product. DreamSpark is more than a single application; the site actually provides access to a number of applications, including Visual Studio 2010 Professional and Microsoft Certification exams.
The Latest News tab provides information in Really Simple Syndication (RSS) form about Visual Web Developer updates and changes. To use this feature, click the Enable RSS Feed option. However, you should know that obtaining the latest information in the IDE can slow things down at times. A better option is to add the site’s RSS feed to Outlook. To do that, first make sure Outlook is running. Copy the Uniform Resource Locator (URL) from the RSS Feed field and paste it into your browser’s address field. Press Enter, and after a few seconds your browser will ask if you want to add the RSS feed to Outlook.