各位:怎么把marquee
从数据库里绑定数据到Marquee中啊.
我开始从程序里这样绑定:
private void Page_Load(object sender, System.EventArgs e)
{
SqlConnection con=new SqlConnection("server=.;database=news;uid=sa;pwd=;");
SqlCommand cmd=new SqlCommand("select top 1 mvNewsName from moveNews order by mvID desc",con);
con.Open();
SqlDataReader sdr=cmd.ExecuteReader(CommandBehavior.CloseConnection);
sdr.Read();
string abc=sdr["mvNewsName"].ToString();//定义变量abc
sdr.Close();
}
然后在<marquee>id="MARQUEE1" onmouseover="this.stop()" style="WIDTH: 190px; HEIGHT: 20px" onmouseout="this.start()" scrollAmount="1" scrollDelay="10" width="190" runat="server"> <%=abc%><%="abc"%></marquee>
结果总是报错:服务器有错误---------------abc----------中没有值
很郁闷,请高手指教指教??????
<%="abc"%>