用querystring值替换嵌入代码

本文关键字:代码 替换 querystring | 更新日期: 2023-09-27 17:51:16

我的代码:

<embed type="application/x-shockwave-flash" id="flash-player-embed" wmode="transparent" src="http://static.xvideos.com/swf/xv-player.swf" quality="high" allowfullscreen="true" allowscriptaccess="always" flashvars="id_video=7966" width="588" height="476">    

我想在上面的代码中像这样分配查询字符串的值:

 < flashvars="id_video=Request.QueryString["vid"]" > 

我想把从查询字符串收到的值赋给7966的位置。我该怎么做呢?

用querystring值替换嵌入代码

试试这个:

flashvars='id_video=<%# (Request.QueryString["vid"] != null) ? Request.QueryString["vid"].ToString() : ""%>'