How to get the value of a SELECT HtmlElement in C# webBrowser control
- by AndrewW
Hi,
In a C# WebBrowser control, I have generated a SELECT HtmlElement with a number of OPTION elements using w.RenderBeginTag(HtmlTextWriterTag.Select).
I need to get the value of the select when the user changes it, and so added an event handler in the WebBrowser DocumentCompleted event.
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
....
webBrowser1.Document.GetElementById("id_select_0").AttachEventHandler("onchange", new EventHandler(ddSelectedIndexChanged));
....
}
protected void ddSelectedIndexChanged(object sender, EventArgs e)
{
....
}
The event handler does get called, but the sender parameter is null and e is empty.
Does anyone know how to overcome this problem?
Andrew