Quantcast

Testing an ASP.NET App with the Default Browser

Get the WebProNews Newsletter:


[ Business]

This article is an excerpt from the book: Murach’s ASP.NET 2.0 Web Programming with C# 2005.

Unless you’ve changed it, Visual Studio uses Internet Explorer as its default browser. Figure 4-4 presents six different ways you can run a web application with the default browser. Three of these techniques start the debugger so you can use its features to debug any problems that might arise. The other three techniques do not start the debugger.

The first time you run a web application using one of the first three techniques, Visual Studio displays a dialog box indicating that debugging isn’t enabled in the web.config file. From this dialog box, you can choose to add a new web.config file with debugging enabled, or you can choose to run the application without debugging. In most cases, you’ll add a new web.config file with debugging enabled so that you can use the debugger with your application.

Before I go on, you should realize that before you can run an application with debugging on a remote server, a program called the Remote Debug Monitor must be installed and running on the server. For information on how to set up this program, see the help topic “How to: Set Up Remote Debugging.”

All of the techniques listed in this figure except the View in Browser command start the application and display the application’s designated start page. However, the View in Browser command displays the selected page. For example, if you right-click the Cart page and choose View in Browser, the Cart page will be displayed. This command is most appropriate for making sure that the pages of an application look the way you want them to.

At this point, you should realize that the type of web site you’re developing determines the web server that’s used to run the application. For example, if you’re developing a file-system web site, the ASP.NET Development Server is used to run the application. In that case, the URL for the page that’s displayed identifies the server as “localhost:” followed by a number that’s assigned by the development server. In contrast, if you’re developing an IIS web site, IIS is used to run the application. Then, the server is identified as just “localhost” for a local web site or by its actual name for a remote or FTP web site.

The Order page displayed in the default browser

Three ways to run an application with debugging

Click the Start Debugging button in the Standard toolbar

Press F5

Choose the Debug -> Start command

Three ways to run an application without debugging

Press Ctrl+F5

Choose DebugStart Without Debugging

Right-click a page in the Solution Explorer and choose View in Browser.

Three ways to stop an application that’s run with debugging

Press Shift+F5

Click the Stop Debugging button in the Debug toolbar

Choose DebugStop Debugging

Description

If you run an application with debugging, you can use Visual Studio’s built-in debugger to find and correct program errors.

By default, an application is run using Internet Explorer. See figure 4-5 for information on using a different browser. To end the application, close the browser.

You should also realize that you can’t just run an FTP application from its FTP location. That’s because this location is used only to transfer files to and from the server. Instead, a browse location must be set up for the web site. A browse location is simply an IIS virtual directory that points to the directory that stores the files for the web site. Then, to access and run the web site, you enter the HTTP URL for the virtual directory. The first time you run an FTP web site, you will be asked to enter this URL. Because the URL is stored as part of the web site, you won’t need to enter it again.

Tag:

Add to Del.icio.us | Digg | Yahoo! My Web | Furl

Bookmark WebProNews:

Joel Murach has been writing and editing for more than 10 years. During that time, he sharpened his programming skills as a contract programmer in San Francisco and his instructional skills as a trainer for HarperCollins Publishing. He always brings a vision to his projects that leads to improved effectiveness for his readers.

Testing an ASP.NET App with the Default Browser
Comments Off
About Joel Murach
Joel Murach has been writing and editing for more than 10 years. During that time, he sharpened his programming skills as a contract programmer in San Francisco and his instructional skills as a trainer for HarperCollins Publishing. He always brings a vision to his projects that leads to improved effectiveness for his readers. WebProNews Writer
Top Rated White Papers and Resources

Comments are closed.

  • Join for Access to Our Exclusive Web Tools
  • Sidebar Top
  • Sidebar Middle
  • Sign Up For The Free Newsletter
  • Sidebar Bottom