100分请高手 ASP.net连接数据库如何实现图片轮换
ASP.net连接数据库如何实现图片轮换,就是类似于新浪、搜狐等一些网站新闻图片切换程序,右下角有1,2,3,4.大部分是用js写的,在网上找了一天,大部分程序都是静态显示,如果要更换图片的话只能手工去改,不能实现后台发布新闻图片,前面就能实时切换显示。而有些连接数据库的拿过来改动后就是显示不了图片,哪位高手如能给一份,不甚感激。要求asp.net的,非常感谢,希望能把程序给全,确实能用,今天在线等待!!!
这份是静态的,能给类似的就行。
<script type="text/javascript">
imgUrl1="images/001.jpg";
imgtext1="走进鄂尔多斯草原 感受自然美景"
imgLink1=escape("http://www.shizhenyuan.com");
imgUrl2="images/002.jpg";
imgtext2="鄂尔多斯遗鸥国家级自然保护区--世珍园旅游区"
imgLink2=escape("http://www.shizhenyuan.com");
imgUrl3="images/003.jpg";
imgtext3="鄂尔多斯遗鸥国家级自然保护区--世珍园旅游"
imgLink3=escape("http://www.shizhenyuan.com");
imgUrl4="images/004.jpg";
imgtext4="碧野茫茫的鄂尔多斯大草原"
imgLink4=escape("http://www.shizhenyuan.com");
imgUrl5="images/005.jpg";
imgtext5="美丽的草原我的家"
imgLink5=escape("http://www.shizhenyuan.com");
var focus_width=588
var focus_height=254
var text_height=18
var swf_height = focus_height+text_height
var pics=imgUrl1+"|"+imgUrl2+"|"+imgUrl3+"|"+imgUrl4+"|"+imgUrl5
var links=imgLink1+"|"+imgLink2+"|"+imgLink3+"|"+imgLink4+"|"+imgLink5
var texts=imgtext1+"|"+imgtext2+"|"+imgtext3+"|"+imgtext4+"|"+imgtext5
document.write('<object 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="images/focus2.swf"><param name="quality" value="high"><param name="bgcolor" value="#F0F0F0">');
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('</object>');
</script>
------解决方案--------------------把这个js弄成静态模板 后台遍历数据替换标签就行了
------解决方案--------------------
C# code
后台
using System;
using System.Data;
using System.Configuration;
using System.Collections;
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;
namespace Vincent.Web.UC
{
public partial class falsh : System.Web.UI.UserControl
{
Vincent.Model.Products MInfo = new Vincent.Model.Products();
Vincent.BLL.Products BInfo = new Vincent.BLL.Products();
protected void Page_Load(object sender, EventArgs e)
{
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/**/
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.Event