Skip to main content
Home Forums Silverlight Programming Programming with .NET - General Call JS from managed code in EB VB (Window.Invoke)
4 replies. Latest Post by rsmith2 on October 13, 2008.
(0)
Kermit75
Member
22 points
47 Posts
10-08-2008 5:54 PM |
I am trying to call JS from managed code using Expression Blend as decribed in the link below.http://msdn.microsoft.com/en-us/library/cc221359(vs.95).aspx
I know the example is for VS2008, but should it not work in EB as well?
I get the errors:* Name 'ControlChars' is not defined* Namespace or type specified in the Imports 'System.Windows.Hosting' doesn't conain any public member or cannot be foiund. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.
WilcoB
720 points
137 Posts
10-08-2008 7:33 PM |
Make sure you only call into HtmlPage properties/methods when HtmlPage.IsEnabled returns true. In Blend it should always return false.
10-10-2008 8:27 AM |
Hi, thanks for the reply.
Can you please clarify what you mean by "calling into"?
I have read this page on HtmlPage.IsEnabled, with no luck.http://msdn.microsoft.com/en-us/library/system.windows.browser.htmlpage.isenabled(VS.95).aspx
When trying to get the value:
Dim value As Booleanvalue = HtmlPage.IsEnabled
I ge an error message, regardles of where I have tried to put the code (even within a new sub).
Do I have to set the value or wait for the value to get set to true?How do I do that?
rsmith2
16 points
3 Posts
10-12-2008 8:52 PM |
You would set this in your web project. Enabled is the default setting, so this souldn't be an issue. <asp:Silverlight ID="Silverlight1" runat="server" Source="~/ClientBin/SandBox.xap" MinimumVersion="2.0.30523" Width="100%" Height="100%" HtmlAccess="Enabled" />
You would set this in your web project. Enabled is the default setting, so this souldn't be an issue.
<
This works for C#
System.Windows.Browser.HtmlPage.Window.Invoke(
System.Windows.Browser.HtmlPage.Window.Eval(
10-13-2008 4:33 PM |
Sorry,
HtmlPage.Window.CreateInstance(