在C#后台中如何写脚本?关于FLASH的
<div id= "tt "> </div>
<script language= "javascript " type= "text/javascript ">
var sp = new SwitchPic( "tt ");
sp.flashPath = "flash/switchPic.swf ";
sp.picFolder = "flash/flashimg/ ";
for (var i=0; i <6; i++)
{
sp.addPic((i+1)+ ".jpg ", " ", "图片 "+(i+1));
}
sp.show();
</script>
这是一段显示FLASH的代码,放在前台可以,但是我想把它写在后台来实现。。不知道怎么声明空间 以及如何来写。。用writer.WriteLine一行行按格式输出,提示有问题。。不知道在C#后台中如何写脚本?望高手指点!!!
------解决方案--------------------string s = @ " <div id= 'tt '> </div>
<script language= 'javascript ' type= 'text/javascript '>
var sp = new SwitchPic( 'tt ');
sp.flashPath = 'flash/switchPic.swf ';
sp.picFolder = 'flash/flashimg/ ';
for (var i=0; i <6; i++)
{
sp.addPic((i+1)+ '.jpg ', ' ', '图片 '+(i+1));
}
sp.show();
</script>
";
Literal1.Text = s;
即可
------解决方案--------------------string s = @ " <div id= 'tt '> </div>
<script language= 'javascript ' type= 'text/javascript '>
var sp = new SwitchPic( 'tt ');
sp.flashPath = 'flash/switchPic.swf ';
sp.picFolder = 'flash/flashimg/ ';
for (var i=0; i <6; i++)
{
sp.addPic((i+1)+ '.jpg ', ' ', '图片 '+(i+1));
}
sp.show();
</script>
";
Page.RegisterStartupScript( "key ",s);
or
Response.Write(s);