hello guys.. I have a gridview in which I show wave file paths and a button control to Play them. Now everything is fine like im getting records (using RowCommand function of GridView) and showing paths. But I am unable to play the sound. I am using <Object> tag embedded in ASP.NET using Literal control. Here is what I am doing.
<script runat="server">
void OnRowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName.Equals("Play Now"))
{
int index = Convert.ToInt32(e.CommandArgument); //this will get rowid from gridview
GridViewRow row = gridCalls.Rows[index];
txt1.Text = row.Cells[5].Text; // second column in the sql server database
this.myLiteral.Text = "<html><body><object>";
this.myLiteral.Text += "<param name='autostart' value='true'>";
this.myLiteral.Text += "<param name='src' value='Likh Raha.mp3'>";
this.myLiteral.Text += "<param name='autoplay' value='true'>";
this.myLiteral.Text += "<param name='controller' value='true'>";
this.myLiteral.Text += "<embed src='Likh Raha.mp3' controller='true' autoplay='true' autostart='True' type='audio/wav' />";
this.myLiteral.Text += "</object></body></html>";
}
}
</script>