使用数据库动态更改youtube src属性 [英] Dynamically change youtube src property using database

查看:79
本文介绍了使用数据库动态更改youtube src属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须设计一个包含youtube视频的网页.我将youtube中的代码嵌入到我的网页中,可以正常播放.现在的问题是客户必须在需要时更改视频.该怎么做.

这里的详细信息:

Homepage.aspx

I have to design a web page which contains youtube video.I embedded the code from youtube it plays fine on my web page.now the problem is client has to change the video when ever he want. how to do that.

Here The Details:

Homepage.aspx

<iframe width="425" height="349" src="http://www.youtube.com/embed/x7M6CdmpgR8" frameborder="0" allowfullscreen></iframe>



MyDatabase:
DatabaseName = Youtube
TableName =来源

ID SourcePath
1 href ="http://www.youtube.com/embed/x7M6CdmpgR8

我想随时更改源路径

然后,该更改必须反映在我的网页



MyDatabase:
DatabaseName=Youtube
TableName=Source

ID SourcePath
1 href="http://www.youtube.com/embed/x7M6CdmpgR8

I wanted to change the source path latter when ever i want

Then that change must be reflect in my webpage

推荐答案

的aspx页面代码上,并在其后添加诸如
之类的属性
on your aspx page code behind make a property like
protected string SourcePath{
get{

string path = "";
path = // get your path from database here
return path;
}
}



在您的aspx页面上
使用

<iframe width="425" height="349" src="<%= SourcePath %>" frameborder="0" allowfullscreen=""></iframe>

我认为应该有帮助



on your aspx page
use

<iframe width="425" height="349" src="<%= SourcePath %>" frameborder="0" allowfullscreen=""></iframe>

i think it should help


这篇关于使用数据库动态更改youtube src属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆