Handling HTML Events in .Net code

From the channel nine screen cast Silverlight - Handling HTML Events in .NET Code by Mike Taulty
 
Void OnLoaded (object sender, RoutedEventArgs e)
{
    HtmlElement element =
        HtmlPage.Document.GetElementById("MyButton");
    element.AttachEvent("onclick", (EventHandler)MyHandler);
}
void MyHandler( object sender, EventArgs args)
{
    //Do something.
}
Comments [0]