How to play a wmv file in my asp net webpage


Playing a WMV file in an ASP.NET webpage can be achieved by the video tag along with the appropriate source attribute. In this article, we will explore how to accomplish this task with .


we begin, make sure you have the following:

  • Basic knowledge of ASP.NET programming
  • An ASP.NET project set up
  • A WMV file that you want to play

Step 1: Adding the WMV File to Your Project

The first step is to add the WMV file to your ASP.NET project. You can do this by right-clicking on your project in Visual Studio and selecting “Add” > “Existing Item”. Browse to the location of your WMV file and select it. Make sure the file is included in your project.

Step 2: Creating the ASP.NET Webpage

Create a new ASP.NET webpage or open an existing one you want to play the WMV file. Add the following code at the desired location within the HTML markup:

Replace “path/to/your/wmv/file.wmv” with the actual path to your WMV file within your project. The “type” attribute specifies the MIME type of the video file.

Step 3: Running the ASP.NET Webpage

Save the to your ASP.NET webpage and run the project. You should now see the video player with the WMV file embedded in your webpage. You can use the controls provided by the video player to play, pause, and seek the video.


Here is an example of how the code should look:

In this example, the WMV file “sample.wmv” is located in a folder named “videos” within the project.


By following the outlined in this article, you should now be able to play a WMV file in your ASP.NET webpage. Remember to adjust the path and file name in the code to match your specific project . Enjoy integrating videos into your web !

Rate this post

Leave a Reply

Your email address will not be published. Required fields are marked *

Table of Contents