Add YouTube to a Web Site - October 2011

If you download this tip please consider making a modest donation.

One application I created uses lots of photos. I was asked by the client to add videos as well. After lots of searching, using Google, I developed an 'easy' way to create a popup screen that loads a YouTube video. The process becomes the October 2011 tip-of-the-month. I wrote a demo application which will display 5 videos. Click here to run the demo. The process is documented below.

The Demo Application

The Asp.Net, VB.Net, VS/2008 project AddYouTubeToWebSite is documented using screen captures:


Click a thumbnail to view a YouTube video.
I found 4 of the videos by searching YouTube.
One I added. It is a video of the RV park where I'm currently staying.


The video loads in a popup page and starts to play.
Click anywhere on the form to close the popup or
click the Close button.

The Concept

An embedded Asp:Repeater is placed on an aspx page which starts a Shockwave, Flash application. Parameters: VideoId and Title are passed to the Repeater using a data table. Simple.

Thanks especially to Igor Alekseev who provided the inspiration. Click here to view his tip. I converted the C# code to VB.Net.

Download the VB.Net Code

Download the source code by clicking on the zipped file name. Click here to run the demo application.

Download - Source Zipped File Size
VS/2008 VB.Net, ASP.Net Solution AddYouTubeToWebSite.zip 101K

Previous Tip    Tip Index    Next Tip

Home

Updated 2011/09/16