New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Language: C#

No Title

111 Views
Copy Code Show/Hide Line Numbers
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Browser;
 
namespace SilverlightApplication1WithASPNET
{
    [ScriptableType]
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
 
            // Register Silverlight to be exposed in JavaScript
            HtmlPage.RegisterScriptableObject("ScriptablePageObject", this);
        }
 
        [ScriptableMember]
        public void JSButtonClick(string sText)
        {
            MyText.Text = sText;
        }
 
      
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            HtmlPage.Window.Invoke("myJSFunction", MyTextBox.Text);
        }
    }
}
by Al Pascual
  January 26, 2010 @ 2:37pm

Add a comment


Report Abuse
brought to you by:
West Wind Techologies


If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate