Introduction
In this beginner's topic, we would demonstrate that how developers can create their first applications using Aspose.Form. In this simple application, we will view an InfoPath form through browser.
Steps to Create a QuickStart Application
Please follow the steps below to create a QuickStart application by using Aspose.Form:
- Create a web application project using MS Visual Studio.NET.
- Modify web.config file to add the customized http module, see here for details.
- Add a FormControl component from the tool palette to the web form.
- Set the TemplatePath property of the added form control to the absolute path of InfoPath template file.
- Finally, view the template in your web browser.
The implementation of above steps is demonstrated below in an example.
Example:
[C#]
private void Page_Load(object sender, System.EventArgs e)
{
//Checking if the page has a postback or not
if (!Page.IsPostBack)
{
//Setting the template path for Aspose.Form control
FormControl1.TemplatePath = Server.MapPath("QuickStart.xsn");
}
}
[VB.NET]
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
'Checking if the page has a postback or not
If Not Page.IsPostBack Then
'Setting the template path for Aspose.Form control
FormControl1.TemplatePath = Server.MapPath("QuickStart.xsn")
End If
End Sub
After executing the above code snippet, you can see the InfoPath templates loaded into the web browser as shown below the in the screenshot:
|
Figure: InfoPath template loaded into web browser
|