Difference between revisions of "Working with SIlverlight"
Jump to navigation
Jump to search
PeterHarding (talk | contribs) |
PeterHarding (talk | contribs) |
||
Line 6: | Line 6: | ||
* http://www.telerik.com/automated-testing-tools.aspx | * http://www.telerik.com/automated-testing-tools.aspx | ||
* http://www.microsoft.com/getsilverlight/handlers/getSilverlight.ashx?v=4.0 | * http://www.microsoft.com/getsilverlight/handlers/getSilverlight.ashx?v=4.0 | ||
=C#= | |||
<pre> | |||
C# | |||
public Page() | |||
{ | |||
InitializeComponent(); | |||
HtmlDocument htmlDoc = HtmlPage.Document; | |||
HtmlElement htmlEl = htmlDoc.GetElementById("Input"); | |||
... | |||
// Add an event handler for the Convert button. | |||
htmlEl = htmlDoc.GetElementById("Convert"); | |||
htmlEl.AttachEvent("onclick", new EventHandler(this.OnConvertClicked)); | |||
} | |||
void OnConvertClicked(object sender, HtmlEventArgs e) | |||
{ | |||
HtmlDocument htmlDoc = HtmlPage.Document; | |||
HtmlElement input = htmlDoc.GetElementById("Input"); | |||
HtmlElement output = htmlDoc.GetElementById("Output"); | |||
output.SetAttribute("value", input.GetAttribute("value").ToUpper()); | |||
} | |||
</pre> | |||
Revision as of 10:55, 5 October 2011
Some Links
The journey begins...
- http://www.silverlight.net/learn/overview/working-with-javascript/html-bridge-%28silverlight-quickstart%29
- http://www.telerik.com/automated-testing-tools.aspx
- http://www.microsoft.com/getsilverlight/handlers/getSilverlight.ashx?v=4.0
C#
C# public Page() { InitializeComponent(); HtmlDocument htmlDoc = HtmlPage.Document; HtmlElement htmlEl = htmlDoc.GetElementById("Input"); ... // Add an event handler for the Convert button. htmlEl = htmlDoc.GetElementById("Convert"); htmlEl.AttachEvent("onclick", new EventHandler(this.OnConvertClicked)); } void OnConvertClicked(object sender, HtmlEventArgs e) { HtmlDocument htmlDoc = HtmlPage.Document; HtmlElement input = htmlDoc.GetElementById("Input"); HtmlElement output = htmlDoc.GetElementById("Output"); output.SetAttribute("value", input.GetAttribute("value").ToUpper()); }