
Signature
All the best,
Coskun SUNALI
MVP ASP/ASP.NET
http://sunali.com
http://www.propeople.dk
Hi...
I got the ashx thing to work. It wasn't that hard. All I had to do was move
the code from PlayAudio.aspx page_load event and put it in ProcessRequest
event of the mp3.ashx file and prepend Context. before all of the response
and request calls. Now that I have that working fine, I have to embed the
audio inside the page itself. I.e. prevent media player from popping up and
playing the file but still be able to play it. I was looking around and saw
that you can use the <object> html tag to embed audio in a page. So, I have
this in my PlayAudio.aspx page:
<object id="AudioFrame" type="audio/mpeg" runat="server" />
So far, so good. Now in the CodeBehind for the PlayAudio.aspx page I have
this:
protected void Page_Load(object sender, EventArgs e) {
//set the data for the audio
AudioFrame.Attributes["data"]="mp3.ashx?ID="+Request.QueryString["ID"];
}
Ok... compiles fine. I run ShowAudio.aspx (it has a list of all audio in the
database with a play link next to it). I pick a track to play and click the
play link. The confusing part comes next... I get this error:
Parser Error Message: An object tag must contain a Class, ClassID or ProgID
attribute.
I read somewhere online that the reason for this problem is something to do
with the runat="server" being in the <object> tag. I would rather keep this
serverside if possible. I just have no clue what class, classid or progid
are used for. When I looked at class and classid for the html tag in a
reference guide, it told me that the class/classid is what identifies the
actual source of the object in the windows registry. It is starting to get
confusing now. Is there any way to fix this? If there is a way that I can
make the <object> client side and still refer to it in codeBehind, then that
would work for me as long as I can still use something like
data="mp3.ashx?ID="+Request.QueryString["ID"] format.
> Hi Andy,
>
[quoted text clipped - 79 lines]
>>>> mediaplayer and leaves me the ability to show song details on the page
>>>> at the same time the file plays. How would I do this?
Coskun SUNALI [MVP] - 05 Feb 2008 21:21 GMT
Hi Andy,
Looks like I got your question wrong so I suggested using an IFrame instead
of an embed or object tag. Though using the ASHX file instead of an ASPX
file to response a file is still fine.
Peter already responded to your object question. I would double his
solution.

Signature
All the best,
Coskun SUNALI
MVP ASP/ASP.NET
http://sunali.com
http://www.propeople.dk
> Hi...
>
[quoted text clipped - 117 lines]
>>>>> mediaplayer and leaves me the ability to show song details on the page
>>>>> at the same time the file plays. How would I do this?