请问如何将这两段前台语言转换成在后台生成?(在线等!)

hanyan100 2011-06-03 09:51:28
因为这是一个播放器的生成格式,所以我需要在后台用datalist动态的去绑定每一个url的值,请问这么将这一段携程在厚爱的一段string值?

<a style="display: block; width: 90px; height: 70px" id="playerVideo"></a>
<!-- this will install flowplayer inside previous A- tag. -->
<script type="text/javascript">

flowplayer("playerVideo", "/_layouts/NCS.OCP.Resource/scripts/flowplayer-3.2.7.swf", {

onLoad: function () { // called when player has finished loading
this.setVolume(30); // set volume property
},
playlist: [

{
url: '/album_03.jpg',
scaling: 'orig'
},
{
autoPlay: false,
autoBuffering: true,
url: 'TestMedia/Kenxin.flv'
}

],
onMouseOver: function () {

this.play();

},
onMouseOut: function () {
this.stop();
}
});

</script>




我要在后台写的方法:
private string VideoPlayerGeneration(string playerId, string videoUrl, string previewUrl)
{// 求高手帮忙!在线等!

...全文
60 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
hanyan100 2011-06-03
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 porschev 的回复:]

引用 2 楼 hanyan100 的回复:

回楼上的,这段js在每一个url绑定的时候都需要载入一遍,用那个注册不用把?


3楼给你说了。。提取一个方法。。。其它地方只用调入这个方法。。

如果你要全输出也可以。。

那就直接拼接字符串。。。
[/Quote]

因为我这这个是从数据库里面取出一个播放的ul,然后就要去天台去把它显示成一个播放器了
所以我是用datalist动态的去绑定值,这个目前想到的只要拼字符串。。。好难。。。
porschev 2011-06-03
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 hanyan100 的回复:]

回楼上的,这段js在每一个url绑定的时候都需要载入一遍,用那个注册不用把?
[/Quote]

3楼给你说了。。提取一个方法。。。其它地方只用调入这个方法。。

如果你要全输出也可以。。

那就直接拼接字符串。。。
porschev 2011-06-03
  • 打赏
  • 举报
回复

记得在注册这个方法时。。。

外面加个function

比如:

///你的这两个参数具体要传哪你自己改,这个我不知道你的这两个参数对应的方法体中哪两个URL

function Abc(videoUrl,previewUrl)
{
flowplayer("playerVideo", "/_layouts/NCS.OCP.Resource/scripts/flowplayer-3.2.7.swf", {

onLoad: function () { // called when player has finished loading
this.setVolume(30); // set volume property
},
playlist: [

{
url: '/album_03.jpg',
scaling: 'orig'
},
{
autoPlay: false,
autoBuffering: true,
url: 'TestMedia/Kenxin.flv'
}

],
onMouseOver: function () {

this.play();

},
onMouseOut: function () {
this.stop();
}
});
}
hanyan100 2011-06-03
  • 打赏
  • 举报
回复
回楼上的,这段js在每一个url绑定的时候都需要载入一遍,用那个注册不用把?
porschev 2011-06-03
  • 打赏
  • 举报
回复

用Page.ClientScript.RegisterStartupScript注册这段JS到前台

110,534

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧