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:
- Using a text editor, in the
\layoutsfolder of your Sitecore installation, create a new
default.aspxpage and insert the following code:
<%@ Page Language="C#" AutoEventWireup="true" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml" >
<form id="form1" runat="server">
- In the Form Designer, in the Export
group, click To ASCX and export the relevant form data to the
\layoutsfolder. Use the
forms.ascxformat for the name of the file.
- In the
default.aspxpage that you created, add the following code after the first
<%@ Register Src="form.ascx" TagName="SimpleForm" TagPrefix="uc1" %>
- Inside the
<form>tag, insert the following code:
<uc1:SimpleForm ID="WebUserControl1" runat="server" />
- In your web browser, enter the following URL: http://localhost/layouts/default.aspx.
After you make changes to the .ascx file, the module does not verify that the form works correctly