Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
InputParameters property
Collapse the table of content
Expand the table of content

InitializeEventArgs.InputParameters property

Sets name/value pairs for use as custom parameters that can be used in the form being initialized in the XmlFormView control.

Namespace:  Microsoft.Office.InfoPath.Server.Controls
Assembly:  Microsoft.Office.InfoPath.Server (in Microsoft.Office.InfoPath.Server.dll)

public Dictionary<string, string> InputParameters { get; }

For more information about query and input parameters, see How To: Use Query Parameters to Invoke Browser-Enabled InfoPath Forms.

In the following example, the InputParameters property is used in the Initialize event of the XmlFormView control to create a name/value pair indicating the department name.

Protected Sub XmlFormView1_Initialize(ByVal sender As Object, ByVal e As Microsoft.Office.InfoPath.Server.Controls.InitializeEventArgs) Handles XmlFormView1.Initialize
    e.InputParameters("Dept") = "Accounting"
End Sub

To use this input parameter in form code, use the InputParameters property of the LoadingEventArgs object available in the Microsoft.Office.InfoPath namespace. For example, the value set in the XmlFormView1 initialization event is used to set a field's value in the form.

protected void XmlFormView1_Initialize(object sender, InitializeEventArgs e)
{
    e.InputParameters["Dept"] = "Accounting";
}

To use this input parameter in form code, use the InputParameters property of the LoadingEventArgs object available in the Microsoft.Office.InfoPath namespace. For example, the value set in the XmlFormView1 initialization event is used to set a field's value in the form.

public void FormEvents_Loading(object sender, LoadingEventArgs e)
{
    XPathNavigator myNav = this.MainDataSource.CreateNavigator();
    myNav.SelectSingleNode("/my:myFields/my:field2", this.NamespaceManager).SetValue(e.InputParameters["Dept"].ToString());
}
Show:
© 2015 Microsoft