帮我看看我这是出了什么问题~(关于新闻图片轮换)
代码如下:<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>AAAA</title>
<style type="text/css">
<!--
body {
margin-top: 0px;
-->
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<table width="950" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="53"><img src="images/top.gif" width="950" height="135" /></td>
</tr>
<tr>
<td height="30"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="950" height="58">
<param name="movie" value="flash/dh.swf" />
<param name="quality" value="high" />
<embed src="flash/dh.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="950" height="58"></embed>
</object></td>
</tr>
<tr>
<td>
<table width="950" border="1" cellpadding="0" cellspacing="0">
<tr>
<td width="300">
<script language="JavaScript">
var focus_width=300;
var focus_height=200;
var text_height=22;
var swf_height = focus_height+text_height ;
var pics=<%=pics%>;
var links=<%=links%>;
var texts=<%=texts%> ;
document.write('<object ID="focus_flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="flash/pixviewer.swf"><param name="quality" value="high"><param name="bgcolor" value="#ff0000">');
document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
document.write('<embed ID="focus_flash" src="flash/pixviewer.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#ffffff" quality="high" width="'+ focus_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object>');
//-->
</script>
</td>
<td width="450">123M<%=pics %>
</td>
<td width="200">
</td>
</tr>
</table>
</td></tr><tr>
<td width="150" >网页底部</td>
</tr>
</table>
</div>
</form>
</body>
</html>
CS代码:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data;
using System.Data.OleDb;
public partial class _Default : System.Web.UI.Page
{
public string pics ="";
public string links ="";
public string texts ="";
protected void Page_Load(object sender, EventArgs e)
{
string strConnection = "Provider=Microsoft.Jet.OleDb.4.0;Data Source=";
strConnection += Server.MapPath("data/#SSdata.mdb");
OleDbConnection objConnection = new OleDbConnection(strConnection);
OleDbCommand objCommand = new OleDbCommand("select top 4 * from pic", objConnection);
objConnection.Open();
OleDbDataReader objDataReader = objCommand.ExecuteReader();
if (objDataReader.Read())
{
pics = "''" + "images/" + objDataReader["pic"].ToString();
links = "''" + "show.aspx?id" + objDataReader["id"].ToString();
texts = "''" + objDataReader["title"].ToString();
}
while (objDataReader.Read())
{
pics = pics + "|" + "images/" + objDataReader["pic"].ToString();
links = links + "|" + "show.aspx?id" + objDataReader["id"].ToString();
texts = texts + "|" + objDataReader["title"].ToString();
}
pics = pics + "''";
links = links + "''";
texts = texts + "''";
}
}
不知道那里出了问题,显示不到~~~ --------------------编程问答-------------------- 先在后台加个断点 跟踪调试一下图片信息从数据库中取去来了吗?
取出来的对吗? --------------------编程问答-------------------- 取出来了啊`可以直接写入前台~把赋值另外拿出来的话是可以显示从数据库读出的结果
可是FLASH是却什么也显示不出来``不知道哪里出现的问题!!!
补充:.NET技术 , ASP.NET