hello guys... I am trying to play a wave file in a small asp.net project. Now I want to embed HTML in asp.net so that I can use <object> tag of HTML to play the wave file. Following is the code to get row index from gridview, from the row I get file path

<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
            }
        }  
    </script>

what should I do?? thnx

If you already know the HTML to play the wav file, you can insert a literal string containing hard coded HTML, and just concatenate your variable in containing the path to the wav file.

If you wrap the whole thing in a AJAX update panel, you can achieve an almost seamless transition here too.

If you already know the HTML to play the wav file, you can insert a literal string containing hard coded HTML

This is exactly what I dont know where and how to insert literal string into asp.net page.

In your gridview, add a literal control, then in the codebehind, set the value to being your HTML

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.