Hello @all,
i've got a problem with the with the performance of the Form. I created a Infopath Form ClientApp in Infopath 2007. There are several Dataconnections and webservices. It opened very fast, if i wanted to preview.
After that, i added a simple C# code on Form_Load here:
using Microsoft.Office.InfoPath;
using System;
using System.Windows.Forms;
using System.Xml;
using System.Xml.XPath;
using mshtml;
namespace _26ab543de70008acustomXsn
{
public partial class FormCode
{
// Member variables are not supported in browser-enabled forms.
// Instead, write and read these values from the FormState
// dictionary using code such as the following:
//
// private object _memberVariable
// {
// get
// {
// return FormState["_memberVariable"];
// }
// set
// {
// FormState["_memberVariable"] = value;
// }
// }
// NOTE: The following procedure is required by Microsoft Office InfoPath.
// It can be modified using Microsoft Office InfoPath.
public void InternalStartup()
{
EventManager.FormEvents.Loading += new LoadingEventHandler(FormEvents_Loading);
}
public void FormEvents_Loading(object sender, LoadingEventArgs e)
{
XPathNavigator xNavRoot = this.CreateNavigator();
//XPathNavigator xNavUserDomain = xNavRoot.SelectSingleNode("dfs:myFields/dfs:queryFields/tns:GetUserOffice/tns:strUser", this.NamespaceManager);
XPathNavigator xNavUserDomain = xNavRoot.SelectSingleNode("pr:properties/p:properties/documentManagement/ns1:DHSAuthorOrOwner/ns1:UserInfo/ns1:DisplayName", this.NamespaceManager);
string UserDomain;
UserDomain = System.Environment.UserDomainName + "\\" + System.Environment.UserName;
xNavUserDomain.SetValue(UserDomain);
// Write your code here.
}
}
}
Now it takes approx. 1 minute to load the Form. What can be the problem? Do i have to configurate something else?
Regards,
Bozo86