我在.net2005的aspx网页里写下面代码 后能显示出来flash
<OBJECT style="width: 847px; height: 123px"><PARAM NAME=movie VALUE="flash/2.swf"> 
<EMBED src="flash/2.swf" WIDTH="432" HEIGHT="134" NAME="2" ALIGN=""></EMBED></OBJECT>
但是我想更新flash 就是把<PARAM NAME=movie VALUE="flash/2.swf>和EMBED src="flash/2.swf" 的flash/2.swf名字换成其他名字 要怎么做
在cs文件里能改变这2个名字吗

解决方案 »

  1.   

    .cs中
    protected string flashPath = string.Empty;
    protected void Page_Load(object sender, EventArgs e)
    {//--获取地址
    flashPath = 你取地址的方法。
    }前台
    <OBJECT style="width: 847px; height: 123px"><PARAM NAME=movie VALUE="<%= flashPath%>"> 
    <EMBED src="<%= flashPath%>" WIDTH="432" HEIGHT="134" NAME="2" ALIGN=""></EMBED></OBJECT>
      

  2.   

    在aspx中可以使用<%= value%>输出在cs文件中定义的变量,在1.1中aspx和cs文件似乎从逻辑上很难理解,但是在2.0中给了aspx文件一个名分,就是cs类文件的一个部分
      

  3.   

    从后台拼接html然后输出也可以
      

  4.   

    1\使用literal来拼
    2\
    <OBJECT style="width: 847px; height: 123px"><PARAM NAME=movie VALUE='<%=flashstr() %>'> 
    <EMBED src='<%=flashstr() %>' WIDTH="432" HEIGHT="134" NAME="2" ALIGN=""></EMBED></OBJECT>  Public Function flashstr() As String
            Return "http://ad4.sina.com.cn/200701/04/79158_home-tonglan02-58590.swf"
        End Function