I believe there is an incompatibility here. The below code does not work, yet if I remove the RadAjaxPanel, it works fine. Code below. Any suggestions would be appreciated since the entire site is RadAjax-enabled.
<body> |
<form id="form1" runat="server"> |
<telerik:RadScriptManager ID="RadScriptManager1" runat="server" /> |
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="200px" Width="300px"> |
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" /> |
<div> |
<asp:MediaPlayer Visible="false" ID="_mediaPlayer" runat="server" AutoUpgrade="true" Width="720" Height="400" ></asp:MediaPlayer> |
</div> |
</telerik:RadAjaxPanel> |
</form> |
</body> |
protected void Button1_Click(object sender, EventArgs e) |
{ |
string path = System.Configuration.ConfigurationManager.AppSettings["SilverLightMovieLocation"] + "/Doe, Oct. 5, 2008"; |
System.IO.DirectoryInfo gallery = new DirectoryInfo(Server.MapPath(path)); |
FileInfo[] movie = gallery.GetFiles("*.wmv"); |
if (movie.GetUpperBound(0) > -1) |
{ |
_mediaPlayer.Visible = true; |
_mediaPlayer.MediaSource = path + "/" + movie[0].Name; |
_mediaPlayer.AutoPlay = true; |
} |
} |