<script type="text/javascript">
<!--
t=5; //secs per slide// promos + links
prmo = new Array();
link = new Array();
for( n=0; n<5; n++)
{
prmo[n]="<%=this.picaddress.Value%>" ;
link[n]="ss"; }
我要出现"prmo = new Array();
link = new Array();prmo[1]="http://www.webjx.com/img/200406301.jpg";//网页制作学习
link[1]="http://www.webjx.com/htmldata/sort/3.html";
prmo[2]="http://www.webjx.com/img/200406302.jpg";//动画制作学习
link[2]="http://www.webjx.com/htmldata/sort/4.html";
//prmo[2]="http://www.webjx.com/img/200406302.jpg"//网页特效
//link[2]="http://www.webjx.com/htmldata/sort/5.html";
prmo[4]="http://www.webjx.com/img/200406303.jpg";//网页编程学习
link[4]="http://www.webjx.com/htmldata/sort/6.html";
prmo[0]="http://www.webjx.com/img/200406304.jpg";//书籍教程下载
link[0]="http://www.webjx.com/htmldata/sort/7.html";
prmo[3]="http://www.webjx.com/img/200406305.jpg";//网页素材下载
link[3]="http://www.webjx.com/htmldata/sort/8.html";
//init
promos = "";
links = "";
"效果//init
promos = "";
links = "";// build flashvars
for (x=0;x<prmo.length;x++) {
promos += (x+1<prmo.length) ? prmo[x]+"|" : prmo[x];
links += (x+1<prmo.length) ? link[x]+"|" : link[x];
}服务器端我是怎么读取的:
public void Page_Load(object sender, EventArgs e)
{ SqlConnection NewsConnection = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["ConnectionString"]);
SqlCommand NewsCommand = new SqlCommand("Select Top 5 * From News Where PicNews='True' Order By NewsID Desc ", NewsConnection); try
{
NewsCommand.Connection.Open();
SqlDataReader Dr = NewsCommand.ExecuteReader();
while (Dr.Read())
{
picaddress.Value =Convert.ToString(Dr["NewsPic2"]);
}
Dr.Close();
} finally
{
NewsCommand.Connection.Close();
}
<!--
t=5; //secs per slide// promos + links
prmo = new Array();
link = new Array();
for( n=0; n<5; n++)
{
prmo[n]="<%=this.picaddress.Value%>" ;
link[n]="ss"; }
我要出现"prmo = new Array();
link = new Array();prmo[1]="http://www.webjx.com/img/200406301.jpg";//网页制作学习
link[1]="http://www.webjx.com/htmldata/sort/3.html";
prmo[2]="http://www.webjx.com/img/200406302.jpg";//动画制作学习
link[2]="http://www.webjx.com/htmldata/sort/4.html";
//prmo[2]="http://www.webjx.com/img/200406302.jpg"//网页特效
//link[2]="http://www.webjx.com/htmldata/sort/5.html";
prmo[4]="http://www.webjx.com/img/200406303.jpg";//网页编程学习
link[4]="http://www.webjx.com/htmldata/sort/6.html";
prmo[0]="http://www.webjx.com/img/200406304.jpg";//书籍教程下载
link[0]="http://www.webjx.com/htmldata/sort/7.html";
prmo[3]="http://www.webjx.com/img/200406305.jpg";//网页素材下载
link[3]="http://www.webjx.com/htmldata/sort/8.html";
//init
promos = "";
links = "";
"效果//init
promos = "";
links = "";// build flashvars
for (x=0;x<prmo.length;x++) {
promos += (x+1<prmo.length) ? prmo[x]+"|" : prmo[x];
links += (x+1<prmo.length) ? link[x]+"|" : link[x];
}服务器端我是怎么读取的:
public void Page_Load(object sender, EventArgs e)
{ SqlConnection NewsConnection = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["ConnectionString"]);
SqlCommand NewsCommand = new SqlCommand("Select Top 5 * From News Where PicNews='True' Order By NewsID Desc ", NewsConnection); try
{
NewsCommand.Connection.Open();
SqlDataReader Dr = NewsCommand.ExecuteReader();
while (Dr.Read())
{
picaddress.Value =Convert.ToString(Dr["NewsPic2"]);
}
Dr.Close();
} finally
{
NewsCommand.Connection.Close();
}
{
prmo.Add(Dr["pic"].ToString());
link.Add(Dr["link"].ToString());
}
pic和link是数据库中的字段,lz要的是这个吗?
{
是否在这里循环 赋值
}
link = new Array();
for( n=0; n <5; n++)
{
prmo[n]=" <%=this.picaddress.Value% >" ;
link[n]="ss"; }
循环读出。
但按ldarmy 这样改我就 不用隐藏控件了。直接用 prmo,link会出现找不到这个名称的错误。在.net中