# Add an ASCX control to the page

Abstract

After converting a form to an ascx file, you can add it to your page.

In the Web Forms for Marketers module, you can convert and export a form to an .ascx file and then add it to your website as an ASCX control. For developers, this can make it easier to develop their custom form control.

To add an ASCX control to the page:

1. Using a text editor, in the \layouts folder of your Sitecore installation, create a new default.aspx page and insert the following code:

<%@ Page Language="C#" AutoEventWireup="true" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<title>Untitled Page</title>
<body>
<form id="form1" runat="server">
</form>
</body>
</html>

2. In the Form Designer, in the Export group, click To ASCX and export the relevant form data to the \layouts folder. Use the forms.ascx format for the name of the file.

3. In the default.aspx page that you created, add the following code after the first <%@ Page> tag:

 <%@ Register Src="form.ascx" TagName="SimpleForm" TagPrefix="uc1" %>

4. Inside the <form> tag, insert the following code:

     <div>
<uc1:SimpleForm ID="WebUserControl1" runat="server" />
</div>
</form>