.wmv video files not playing in FormsAuthentication

Posted by Sreeharijakkala under ASP.NET on 9/16/2011 | Points: 10 | Views : 1676 | Status : [Member] | Replies : 1
Hi All,

Issue is .wmv video files not playing in FormsAuthentication. for public .wmv files working fine.

I have a forms authentication for .wmv files , i was used the below code in global.asax file, its working fine in local m/c through Visualstudio2010.

when i am uploading to server (IIS7) sqlserver2005,i given .wmv file direct link(http://domainname/partner-files/videos/en/Content-in-a-Box-Webinar-20110713-1502-1.wmv) in browser its redirecting to login page then after username password, its giving the following error

"Windows Media Player encountered a problem while playing the file. For additional assistance, click Web Help."

can any one pls help me on this issue.

<script runat="server" language="c#">

void Application_PreSendRequestHeaders(Object source, EventArgs e)

HttpApplication app = (HttpApplication)source;
HttpCookieCollection cookies = app.Context.Response.Cookies;
if (cookies != null)
foreach(string name in cookies)
HttpCookie cookie = cookies[name];
if (cookie.Name.Equals(FormsAuthentication.FormsCookieName, StringComparison.OrdinalIgnoreCase))
cookie.HttpOnly = false;



Posted by: Vuyiswamb on: 9/16/2011 [Member] [MVP] [Administrator] NotApplicable | Points: 25

I think you need to pass the username and password in the Query-string ,

Thank you for posting at Dotnetfunda

Sreeharijakkala, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response