We recommend using Visual Studio 2017
This documentation is archived and is not being maintained.

Walkthrough: Creating a Simple Web Application

In this walkthrough, you will create a simple Web application to use as the basis for a Web performance test in Walkthrough: Recording and Running a Web Performance Test.

To create a sample Web performance test, you should use a Web application to which you can make arbitrary changes.

In this walkthrough, you will perform the following tasks:

  • Create a simple Web application.

  • Test the Web application manually.

For this walkthrough you will need:

  • Microsoft Visual Studio 2010 Ultimate

To create the Web application

  1. In Visual Studio 2010 Ultimate, on the File menu, choose New and then choose Project.

    The New Project dialog box appears.

  2. Under Installed templates, expand the programming language that you prefer and then choose Web.

  3. In the list of Web project types, select ASP.NET Empty Web Application.

    NoteNote

    You will write minimal code in this walkthrough.

  4. In the Name box, type ColorWebApp.

  5. In the Location box, specify the folder where you want to create your Web application.

  6. Select Create directory for solution.

  7. Click OK.

  8. In Solution Explorer, verify that the new ColorWebApp project is selected.

  9. On the Project menu, choose Add New Item.

    The Add New Item dialog box appears.

  10. In the list of items, choose Web Form.

  11. In the Name text box, type Default.aspx and then choose Add.

To add controls to the Web application

  1. In Solution Explorer, right-click Default.aspx and choose View Designer.

    A blank page is displayed.

  2. If the toolbox is not visible choose View and then choose Toolbox.

  3. From the Standard group, drag a RadioButtonList onto the page.

    A RadioButtonList control is added to the design surface.

  4. Expand the RadioButtonList Tasks action tag pane, and choose the EditItems link.

    A ListItem Collection Editor appears.

    NoteNote

    You can also display the ListItem Collection Editor by editing the Items collection on the Properties window.

  5. Choose Add to add a new item.

  6. Under ListItem properties:

    1. Change the Text property to Red.

    2. Set the Selected property to True.

  7. Choose Add to add another item.

  8. Under ListItem properties change the Text property to Blue.

  9. Choose OK to close the ListItem Collection Editor.

  10. Drag a Button onto the page and in the Properties window, change the Text property to Submit.

  11. On the File menu, choose Save All.

To add pages to the Web application

  1. On the Project menu, choose Add New Item.

  2. In the Add New Item dialog box, select Web Form from the list of template, and in Name type Red.aspx, and then choose Add.

  3. At the bottom of the document window, choose the Design tab to switch to design view.

  4. Drag a Label onto the page. In the Properties window, set the Text property to Red, and the ForeColor property to Red.

  5. On the Project menu, choose Add New Item.

  6. In the Add New Item dialog box, choose the Web Form template, name it Blue.aspx, and then choose Add.

  7. At the bottom of the document window, choose the Design tab to switch to design view.

  8. Drag a Label onto the page. In the Properties window, set the Text property to Blue, and the ForeColor property to Blue.

  9. On the File menu, choose Save All.

To add functionality to the Web application

  1. In Solution Explorer right-click Default.aspx and choose View Designer.

  2. Double-click the Submit Button. Visual Studio switches to the page code, and creates a skeleton event handler for the Button control's Click event.

  3. Add the following code to the event handler:

    if (this.RadioButtonList1.SelectedValue == "Blue")
    {
        Response.Redirect("Blue.aspx");
    }
    else
    {
        Response.Redirect("Red.aspx");
    }
    

    If RadioButtonList1.SelectedValue = "Blue" Then
        Response.Redirect("Blue.aspx")
    Else
        Response.Redirect("Red.aspx")
    End If
    

  4. On the File menu, choose Save All.

To test the Web application manually

  1. In Solution Explorer, right-click Default.aspx and then choose Set As Start Page.

  2. Press CTRL+F5 to run the Web application in the browser. You will see the first page.

  3. Choose Red and then choose Submit. If the application is working correctly you will go to the page with the Label that says Red.

  4. Go back to the first page.

  5. Choose Blue and then choose Submit. If the application is working correctly you will go to the page with the Label that says Blue.

In this walkthrough you created a simple Web application and tested it manually. Now you are ready to create a Web Performance Test that lets you test this application. For more information, see Walkthrough: Recording and Running a Web Performance Test.

Show: