Click here to Skip to main content
15,881,516 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have an scenario where on page load i get the user id from database and have to show his movie on the webpage,
i have saved the viemo video url of every user in the database, i want to know that how can i assign the src in code behind against the particular user.

XML
<iframe src="//player.vimeo.com/video/91467577?title=0&amp;byline=0&amp;portrait=0&amp;color=ffffff" width="500" height="281" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
Posted

1 solution

in code behind you need to have the following code:

C#
protected void Page_Load(object sender, EventArgs e)
   {
       myIframe.Attributes["src"] = "http://www.youtube.com/watch?v=NEcZmT0fiNM&list=PLp12xt0S4J0UYXerKrIPCLTk15ZUzFdKz";
   }

and Also you need to make iframe to be accessible in server side by changing yours to the following one :

XML
<iframe src="//player.vimeo.com/video/91467577?title=0&byline=0&portrait=0&color=ffffff" width="500" height="281" frameborder="0">
        webkitallowfullscreen mozallowfullscreen allowfullscreen runat="server" ID="myIframe"></iframe> 

if you take a look I only added these two properties to yours 'runat="server"' and ID="myIframe"

hope it helps
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900