How to show youtube video in ASP.Net web page?

You can configure these properties when you show a youtube video in your webpage:

VideoUrl: This property allows you to set URL of the video.
Width: Sets the width of the video player
Height: Set the height of the video player

We use variable youtube url that value initialize at run time. We can set the value of variable by fetch the url that store from data base or by passing page label.


<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344"
<param name="src" value="<%=youtubeurl %>" />
<embed type="application/x-shockwave-flash" width="425" height="344" 
  src="<%=youtubeurl %>">

write the code on your .cs page:

public string youtubeurl;
    protected void Page_Load(object sender, EventArgs e)

Like above code we initialize variable at page load.

Author: Pavan

I am developer have good knowledge of ver 05,08,10 and good hand in sql server.Proficient in Object Oriented Programming and javascript, jQuery. Achievements - Integrate Spotfire, appnexus API with sql server. Hobbies - Blogging ,Games, Movies ,Teaching,Keeping myself update with new technologies

2 thoughts on “How to show youtube video in ASP.Net web page?”

  1. i am tried with this code
    and no video window also not displaying here.what is the reason 

  2. Hello Anu,
                  Please send us code that ur using now with detail which youtube link ur using like embed link or normal link.


Comments are closed.