---
title: "Quick Start in Web Forms"
canonical: https://www.graphicsmill.com/docs/gm5/QuickStartinWebForms.htm
product: "Graphics Mill 5.5 for .NET"
---

This documentation is for the old version. [Go to the latest Graphics Mill docs](https://www.graphicsmill.com/docs/gm/)

# Quick Start in Web Forms
 
This topic describes how to get started with Graphics Mill for .NET when creating an ASP.NET application. It provides step-by-step instructions how to create a simple Web Forms application which loads an image and displays it.
 
1. Create new Web site in the Visual Studio 2005 (menu **File** -&gt; **New** -&gt; **Web Site**).
2. Add the [BitmapViewer](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_WebControls_BitmapViewer.htm.md) control to the toolbox:
    - Right click the component toolbox and select **Choose Items**.
    - Find the **BitmapViewer** component in the **.NET Framework Components** tab. If you cannot find this component for some reason, click the **Browse** button and find the **Aurigma.GraphicsMill.WebControls.dll** assembly. It should be looking as follows: 
        ![Visual Studio Choose Toolbox Items dialog](https://www.graphicsmill.com/docs/gm5/QuickStartinWebForms1.png)
3. Find ![BitmapViewer icon](https://www.graphicsmill.com/docs/gm5/BitmapViewer.gif)BitmapViewer item at the toolbox and drag it at the form. As a result, the form should be looking similar to this screenshot: 
    ![Visual Studio Form Designer](https://www.graphicsmill.com/docs/gm5/QuickStartinWebForms2.png)
4. Create a folder named **Photos** and put some photo there. In our case it is the **Sample.jpg** file.
5. Click anywhere on the form in order to generate a handler for the **Load** event of the **Page** object and add the code which will load the sample photo: 
 
```
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.LoadBitmapViewer1.Bitmap.Load(Server.MapPath("Photos/Sample.jpg"))
    End Sub
    ```
 
```csharp
    private void Page_Load(object sender, System.EventArgs e)
    {BitmapViewer1.Bitmap.Load(Server.MapPath("Photos/Sample.jpg"));
    }
    ```
6. Toggle to the **Source** mode and change the doctype of the page from XHTML 1.0 Transitional: 
```html
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    ```
 to HTML 4.0 Transitional: 
```html
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" >
    ```
 Also, remove XHTML namespace declaration from the **&lt;html&gt;** tag, i.e. replace this: 
```html
    <html xmlns="http://www.w3.org/1999/xhtml">
    ```
 by this one: 
```html
    <html>
    ```
 
**Remark** 
This step is necessary as a workaround of a problem with scrollbars which occurs in Internet Explorer 6. This problem is caused by a bug in Internet Explorer which misbehaves with certain XHTML code. It does not occur on other browsers such as Firefox, Mozilla, Safari, and Opera.
7. Run the application (menu **Debug -&gt; Start Without Debugging** or **Ctrl+F5** shortcut).

After you run the application and load some image, it will be looking like this screenshot:
 ![Sample application.](https://www.graphicsmill.com/docs/gm5/QuickStartinWebForms7.png)
