|
I have 2 silverlight controls in a aspx page. Control A fires a static event, and Control B listens to it. Since they are in different DLLs, i've added a reference from Control A into B.
Sadly, B never hears the event, i know its being fired as i've added some debug messages.
Does silverlight not allow this type of functionality ? or am i going about it the wrong way?
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
I think the only way you could make that work, would be to have both of them communicate with their parent container and let the parent be the go-between.
If you look at the test web page that VS2008 generates, there's some javascript in there that might give you a clue how to go about it:
function onSilverlightError(sender, args) {<br />
<br />
var appSource = "";<br />
if (sender != null && sender != 0) {<br />
appSource = sender.getHost().Source;<br />
} <br />
var errorType = args.ErrorType;<br />
var iErrorCode = args.ErrorCode;<br />
...<br />
...
You could maybe pass a custom function to your Silverlight objects as a parameter the same way the error handler is passed:
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%"><br />
<param name="source" value="ClientBin/SilverlightApplication2.xap"/><br />
<param name="onerror" value="onSilverlightError" /><br />
<param name="background" value="white" /><br />
<param name="minRuntimeVersion" value="2.0.31005.0" /><br />
<param name="autoUpgrade" value="true" /><br />
<a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;"><br />
<img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/><br />
</a><br />
</object>
It's just a thought...don't know if it'd work or not
Update: I don't think my above suggestion will work. I found an interesting video on InitParams here[^] though.
Update2: Oh yes you can do it. Here's a video[^] that tells how
modified on Sunday, October 26, 2008 1:10 PM
|
|
|
|
|
Hi,
I am a beginner to silverlight.i would like to know what are the installers to get silverlight effects.
I installed Microsoft Silverlight1.1 Tools Alpha for Visual Studio 2008 and Microsoft Silverlighr1.1 Alpha Refresh. And i opened new silverlight scriptweb and created new aspx page.when i run that application i didn't get any changes according to silverlight. And there is a silverlight.js file by default.what is the use of that file and how to use that file.Please help me how to solve my silverlight problem.
Thanks
pavani
|
|
|
|
|
Has anyone been able to get an SL app successfully communicating with a self-hosted WCF service? My SL app complains about a badly configured ClientAccessPolicy.xml file, but according to every article and post I've read, I'm doing the right thing. Web Development Helper confirms my SL app successfuly accesses the file (whose headers and content are A-OK). I'm also able to manually browse the ClientAccessPolicy.xml file with no problems and communicate with the service using non-SL apps just fine. (The service itself is a trivial one.)
Thanks for any light you can shed on a solution. (Sorry, hosting the service in IIS isn't a solution ).
Thanks,
/ravi
|
|
|
|
|
Ravi - answering questions with questions here I'm afraid. What do you mean by self-hosted?
|
|
|
|
|
I mean the WCF service runs in a Windows service or console/WinForms app using an instance of a ServiceHost class, instead of running as a .svc in IIS. Thanks for any help you can provide!
/ravi
|
|
|
|
|
Figured it out - CP article coming soon.
/ravi
|
|
|
|
|
Ravi
I suspect you may have the key to my problem as well. I'm running a C# .NET web service under IIS with an accessible ClientAccessPolicy file too. I can call the service from an SL2 app running on the same machine and another machine running on the same intranet but not from an apparently different domain.
Thoughts?
|
|
|
|
|
Ugh.
Are you able to add a service reference (from scratch) by running VS2008 on a PC in the different domain? IOW, SL aside, are you even able to see the service from the PC on the different domain?
/ravi
|
|
|
|
|
Hello Ravi
I can see the service description page from the external site (1 below).
It all gets a little complex as the only way to test this is to use a GotoMyPc connection (essentially Citrix) to a machine 300 miles away in London and browse back to my desktop here!
Here are 3 URLs - youll need SL2 RTW for #2 to work. What do you see?
1. Raw service: http://ubik8.dyndns.org/novaserver/service1.asmx[^]
2. SL2 app which calls the above: http://ubik8.dyndns.org/novaclient/default.html[^] Just press the Connect button.
3. and the policy file ... http://ubik8.dyndns.org/novaclient/clientaccesspolicy.xml[^]
BTW on the remote machine I used IE7 with the WDH extension added. It gives no clues. Why is this so complicated .. I'd have expected the SL2 <-> IIS Web Service to be an extremely common use case.
Thx
Jerry
|
|
|
|
|
Jerry Evans wrote: Why is this so complicated ..
My thoughts exactly.
I can see your config file in my browser - it looks good. However, I think it's the SL client that's impeding access and not your firewall or webserver setup; I don't see the app trying to access CAP.xml.
/ravi
|
|
|
|
|
Hi Jerry, any success?
/ravi
|
|
|
|
|
Does anyone know how to listen to a custom static event in a .NET control from silverlight?
I cant add the reference to the .NET dll as VS2008 complains about it not being a silverlight assembly.
Anyone got an ideas how i'd get around this?
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
You can only reference DLLs compiled in SL from SL projects. So, you will need to build the DLL you trying to reference in SL. SL contains a subset of .net (as well a subset of WPF).
|
|
|
|
|
We are developing W PF application which uses .net framework 3.0 for compilation.We are not getting error in runtime or during compiling/debugging. But When we deploy the same application in the system in which visual studio 2008 is not installed we get the following error occurs when navigation takes from one page to other page.
system.windows.xamlparseexception
cannot create instance of "Page1" in defined assembly.
exception has been thrown by target of an invocation
error in markup file 'page1.xaml'
system.reflection.targetinvocation exception
exception has been thrown by target of an invocation
system.ArguementException:Arguement Prompt cannot be converted to type string
could anyone please help us asap?
|
|
|
|
|
dwarakk wrote: Prompt cannot be converted to type string
This is the key to your problem.
I'm not sure what Prompt is.
Would it make more sense to load .NET 3.5 SP1 on your development machine and target machine? Eliminate issues like this?
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Hi guys.
In SilverLight we can use C#.NET or VB.NET for programming or we should use Javascript ?
Many thanks in advance
|
|
|
|
|
If you're using Silverlight 2, you can use C# or VB.NET. If it's pre version 2, you had to use JavaScript.
|
|
|
|
|
Thanks Pete. You truly are an expert.
Pete O'Hanlon wrote: If you're using Silverlight 2, you can use C# or VB.NET. If it's pre version 2, you had to use JavaScript.
So if we use C# or VB, it will be Server side ? yes ?
|
|
|
|
|
Mohammad Dayyan wrote: So if we use C# or VB, it will be Server side ? yes ?
Well yes and no. The beauty about Silverlight 2 is it runs a low footprint CLR in the browser.
|
|
|
|
|
You can use either C# or VB.NET. Pick which ever one suits you best
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
But in Silverlight1 I couldn't use C# !!!
|
|
|
|
|
Mohammad Dayyan wrote: Silverlight1 I couldn't use C#
Which is why I didn't really look at Silverlight until Silverlight2. Are you developing in Silverlight1? If so, you should move to Silverlight2
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
I'm building a proof of concept using VS 2008 and the very latest Silverlight 2.
What do I need to do to deploy to a commercial host? DiscountASP.net in this case. Is it simply a case of copying the contents of \release onto the server? Where is the FAQ on this topic - seems to be AWOL
Any help appreciated.
Thx++
|
|
|
|
|
I'd be interested in how that works too. There isn't anything useful in the help file about it...I'm thinking that it's the same as deploying an ASP.Net based site, so you might look from that perspective.
I did find one potential 'gotcha' about mime-types that I didn't know about here[^]
|
|
|
|