Skip to main content
Home Forums Silverlight Programming Programming with JavaScript How do I use onLoad?
2 replies. Latest Post by WynApse on May 11, 2007.
(0)
WynApse
Star
8456 points
342 Posts
05-11-2007 2:03 AM |
I'm still having trouble with the GlyphMap demo: http://www.wynapse.com/Silverlight/Silverlight_GlyphMap_Utility.aspx particularly in Firefox, but sometimes in IE6.
The issue is that the center content of all the Glyphs is not being loaded.
In reading about using onLoad:somefunction ... I thought maybe I could split out the global variable instantiation from all the createFromXaml code and just do the inits in the xaml Loaded function and fill my grid 'o' Glyphs in the onLoad ... and it worked locally, but yowzer... I could NOT figure out where to poke it to make it work from the web ... using IE7, too! ... forget Firefox... lots of errors there.
So now I've restored it all to a 'stable' position. it works fine in IE7, but Firefox isn't displaying a thing and is givin gme "cyclic_proto_value" errors ...
So I guess I'm asking if I had the right idea about using onLoad, and if so, does someone have a good working example. I used the correct prototype for it according to the documentation, so I at least got that far. if I made it onLoad:onLoad and then had my function named onLoad, it complained it couldn't find it... just confusing...
Any help??
Thanks!
-Dave
bryant
9937 points
1,629 Posts
05-11-2007 1:42 PM |
Did you get this worked out? According to the SDK the onLoad is supposed to be called after all the loaded events fire in the xaml objects:
http://msdn2.microsoft.com/en-us/library/bb412401.aspx#Using_the_OnLoad_Event
05-11-2007 3:42 PM |
Hi Bryant...
That's why I wanted to use OnLoad in the manner I described. I'm not sure, but it sounds like just possibly I have a race condition on my hands because if I load up all that createFromXaml during the Canvas "Loaded", I'm thinking I'm getting hammered by something.
So if I just do the minimal I need to set some things up in the Canvas "Loaded", and then do the heavy-lifting in the OnLoad... which is after the other... but I just had zero luck doing so.
Like I said... it worked perfectly locally, but when I put it on my site, it acted like I'd left off the onLoad function...