Stream audio using HTML5 audio tag and asp generic handler
<p>I am trying to add the html5 audio tag dynamically into my page and stream tag source using generic handler. But problem is that when I dynamically using jquery add audio tag with source elmenet the source element with generic handler fires page lyce cycle. This behavior is really strange. Do you know where should be the problem? I cant also seek the audio file using this handler:</p>

<pre><code>public void ProcessRequest(HttpContext context)
    {
        try
        {
            if (context.Request.QueryString["source"] == null)
                throw new ArgumentNullException("source");

            string audioGuid = context.Request.QueryString["source"];
            string audioFolder = Path.Combine(context.Server.MapPath("~"), "DATA\\some-school-name\\audio");

            DirectoryInfo di = new DirectoryInfo(audioFolder);
            FileInfo fi = di.GetFiles(String.Format("{0}.*", audioGuid)).First();

            string filePath = Path.Combine(audioFolder, String.Format("{0}{1}", audioGuid, fi.Extension));

            context.Response.Clear();
            context.Response.Buffer = true;
            context.Response.AppendHeader("Content-Length", fi.Length.ToString());
            context.Response.ContentType = "audio/mpeg";
            context.Response.WriteFile(filePath);
            context.Response.Flush();
            context.Response.Close();
        }
        catch (FileNotFoundException)
        {
            context.Response.Write("&lt;p&gt;Hudební soubor nebyl nalezen.&lt;/p&gt;");
        }
    }
</code></pre>

<p>Could you tell me what is the best way to stream audio without firing page life cycle and allowed audio seeking?</p>

<p>Thank you for your replies.</p>
