- 精品下载 | 实用查询 | 词典查询 | 桌面壁纸 | 网址 | 笑话 | FLASH频道 | 天气文章资讯 | 站长工具 | 证件办理 | 闪字生成 | 广告代码 | 在线手册 | 有问必答
您现在的位置: 蓝派网 >> 文章中心 >> 网络编程 >> AJAX >> 正文
站内文章搜索:           

Ajax无刷新实现图片切换特效

作者:佚名    文章来源:网络转载    更新时间 :2007-11-25 13:34:56

一、AjaxMethod
using System;
using System.Data;
using System.Data.SqlClient;

namespace AjaxImage
{
    /**//// <summary>
    /// AjaxMethod 的摘要说明。
    /// </summary>
    public class AjaxMethod
    {
        public AjaxMethod()
        {           
        }
        public static string ConnectionString = System.Configuration.ConfigurationSettings.AppSettings["ConnectionString"].ToString();

        GetDataSet#region GetDataSet
        public static DataSet GetDataSet(string sql)
        {
            SqlDataAdapter sda = new SqlDataAdapter(sql, ConnectionString);
            DataSet ds = new DataSet();
            sda.Fill(ds);
            if (ds != null)
                return ds;
            else
                return null;
        }
        #endregion

        [AjaxPro.AjaxMethod]
        public static DataSet GetPhotoList( int iCategoryID )
        {
            string sql = "Select id,photo_path FROM Photo where photo_category_id=" + iCategoryID ;
            return GetDataSet( sql );
        }
        [AjaxPro.AjaxMethod]
        public static DataSet GetPhotoInfo( int id )
        {
            string sql = string.Format("SELECT photo_title, photo_description FROM Photo WHERE id = {0}", id);
            return GetDataSet( sql );
        }

    }//end class
}

二、页面HTML代码:
<div id="Layer1" style="Z-INDEX:1; LEFT:104px; WIDTH:501px; POSITION:absolute; TOP:28px; HEIGHT:345px">
                <img name="slideShow" src="http://www.esdn.net.cn/Files/BeyondPic/2006-11/20/061120140349189.gif" width="500" height="300" style="FILTER:revealTrans(duration=2,transition=23)">
            </div>
            <div id="Layer2" style="Z-INDEX:2; LEFT:490px; WIDTH:112px; POSITION:absolute; TOP:380px; HEIGHT:26px">
                <img id="btnPlay" src="http://www.esdn.net.cn/Files/BeyondPic/2006-11/20/06112014034966390.gif" onclick="slideshow_automatic()" onmouseover="this.src="http://www.esdn.net.cn/Files/BeyondPic/2006-11/20/06112014035083512.gif""
                    onmouseout="this.src="http://www.esdn.net.cn/Files/BeyondPic/2006-11/20/06112014035186814.gif""> <img id="btnPause" src="http://www.esdn.net.cn/Files/BeyondPic/2006-11/20/06112014035566652.gif" onclick="pauseSlideShow()" onmouseover="this.src="http://www.esdn.net.cn/Files/BeyondPic/2006-11/20/06112014035592227.gif""
                    onmouseout="this.src="http://www.esdn.net.cn/Files/BeyondPic/2006-11/20/06112014035663725.gif""> <img id="btnPrev" src="http://www.esdn.net.cn/Files/BeyondPic/2006-11/20/06112014035798128.gif" onclick="previous_image()" onmouseover="this.src="http://www.esdn.net.cn/Files/BeyondPic/2006-11/20/06112014035891115.gif""
                    onmouseout="this.src="http://www.esdn.net.cn/Files/BeyondPic/2006-11/20/06112014035953355.gif""> <img id="btnNext" src="http://www.esdn.net.cn/Files/BeyondPic/2006-11/20/06

[1] [2] [3] [4] [5] 下一页

 
【相关文章:】
没有相关文章

发表评论】【打印此文】【关闭窗口】【点击数:
★好玩的休闲小游戏★
网友评论:
数据载入中,请稍后……