I am stumped here. I have a project in which I call the following
StringBuilder StringBuilder = new StringBuilder();
StringBuilder.Append("<script type='text/javascript' id='VideoSelection'> ");
StringBuilder.Append("function SilverlightChangeVideo(videoID) ");
StringBuilder.Append("{ ");
StringBuilder.Append(Environment.NewLine);
StringBuilder.Append(" var SLPlugin = document.getElementById('"+strSilverlightVideoPlayerID+"');");
StringBuilder.Append(Environment.NewLine);
//StringBuilder.Append(" var strOut = SLPlugin.Content.ChangeMedia.ChangeVideo(videoID); ");
StringBuilder.Append(" alert(SLPlugin); ");
StringBuilder.Append("} ");
StringBuilder.Append("</script> ");
return StringBuilder.ToString();<br/><br/><br/><br/><br/><br/>
Now my problem is that when I do this I set an alert on SlPlugin and it returns null. Now if I got and view source of the webpage and copy the same ID it works. Seems like an encoding issue or something. I have tried to rencode the string to UTF8 but this didn't seem to fix it.
Now if I type the ID in the javascript it doesn't work either. Yet when I copy and paste from IE8's view source it works. Here is the ID as copied from the view source window in IE8.
Here is the silverlight object ID copied from my page:
dnn_ctr510_View_ViaCastVideoPlayer
Any ideas?