Our company has a intranet based website using which we have to place request for conference calls, every time we have to place a request we have to get the details of persons from Outlook properties and fill in the form. To overcome this, I am creating a Outlook Add in, which will open the website using .NET WebBrowser control , fill in the required data from LDAP and submit the page, all the information will flow from Meeting request page. The problem is that Website needs a post back to load few extra controls based on the data entered on click of a button, but when I try to click that button dynamically, webBrowser_DocumentCompleted event is called properly but the page does not seem to refresh properly, in ideal case I would expect new controls to be present in the page, but the webBrower control still shows me old page.
Any pointer if I can achieve same functionality in some other way or of there is anything I need to do to get this fixed.
Please note that I cannot change the way intranet Website behaves. I am using .NET 3.5 and Outlook 2007
Initializaton code snippet
WebBrowser wbBuzzConf = new WebBrowser();
wbBuzzConf.Url = new Uri(ConfigurationManager.AppSettings.Get("ConfAddress"), System.UriKind.Absolute);
wbBuzzConf.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(wbBuzzConf_DocumentCompleted);
void wbBuzzConf_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
try
{
WebBrowser wbBuzzConf = sender as WebBrowser;
// Check if new controls are loaded
if (wbBuzzConf.Document.GetElementById("txtEmailOut1") != null)
{
}
else
{
wbBuzzConf.Document.GetElementById("txtNoOfDialOuts").InnerText = users.Count > 5 ? "5" : users.Count.ToString();
//DO POST BACK TO LOAD NEW CONTROLS
wbBuzzConf.Document.GetElementById("imbtGo").InvokeMember("click");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}