Microsoft KB Archive/266230

= Events with ASP Page Do Not Work Correctly =

Article ID: 266230

Article Last Modified on 8/29/2001

-

APPLIES TO


 * Microsoft Windows Media Player 6.4

-



This article was previously published under Q266230



SYMPTOMS
An &quot;ad&quot; insertion with event tags in an .asx file does not work as expected when it points to an ASP page that generates pages dynamically. Although the ASP page generates a different .asx file every time, Windows Media Player always uses the first one.

The following sample files demonstrate this behavior.

Sample .asx file:  Live Stream     Sample ASP page: <% @LANGUAGE=&quot;VBSCRIPT&quot; %> <%   Response.ContentType = &quot;video/x-ms-asf&quot; Response.Write &quot;&quot; & vbCrLf Dim MovNum Dim MovieURL MovNum = Application(&quot;MovieNumber&quot;) MovNum = CInt(MovNum) +1 If MovNum = 4 Then MovNum = 1 Application(&quot;MovieNumber&quot;) = MovNum Response.Write &quot; &quot; & &quot;Ad Number&quot; & CStr(MovNum) & &quot; &quot; & vbCrLf Response.Write &quot; &quot; & vbCrLf %> .asf&quot; /> <%   Response.Write &quot; &quot; & vbCrLf Response.Write &quot; &quot; & vbCrLf %>



WORKAROUND
To work around this behavior, let the ASP page generate one URL instead of one .asx file.

The following sample ASP page works with Windows Media Player: <% 'Replace the following static URLs with database queries 'or Ad Server queries to generate a dynamic URL

Randomize Index=Int(5*Rnd+1)

select Case Index case 1 Response.Write &quot;mms://server1/upgrade.ASF&quot; case 2 Response.Write &quot;mms://server1/sample.ASF&quot; case 3 Response.Write &quot;mms://server1/welcome1.ASF&quot; case 4 Response.Write &quot;mms://server1/welcome2.ASF&quot; case 5 Response.Write &quot;mms://server1/welcome3.ASF&quot; end select %>



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

Keywords: kbprogramming kbprb KB266230

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.