您的位置:首页 > 其它

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

2008-02-18 10:27 671 查看
1.页面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 AjaxPro;

public partial class _Default : System.Web.UI.Page

<html xmlns="http://www.w3.org/1999/xhtml" >

<head runat="server">

<title>Ajax无刷新实现图片切换特效</title>

<link type="text/css" href="css/tree.css" rel="stylesheet">

<link type="text/css" href="css/global.css" rel="stylesheet">

<script type=text/javascript src=javascript/tree.js></script>

</head>

<body onload="PreloadImage('<%=displayCategoryID %>');">

<form id="form1" runat="server">

<div id="photoarea" style="width: 514px; height: 496px; left: 0px; top: 0px;">

<div id="photo" style="left: 5px; top: 9px; height: 432px;">

<img id="slideShow" src="images/space.gif" style="filter:revealTrans(duration=2,transition=23)">

</div>

<div id="op" align="left" style="left: 12px; top: 457px">

<span id="progress" style="FONT-SIZE: 20px"></span>

   

<img id="btnPlay" src="images/play_bw.gif">

<img id="btnPause" src="images/pause_bw.gif">

<img id="btnPrev" src="images/prev_bw.gif">

<img id="btnNext" src="images/next_bw.gif">

</div>

</div>

</form>

</body>

</html>
3.AjaxMethod类

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.SqlClient;

using AjaxPro;

public class AjaxMethod

<?xml version="1.0"?>

<configuration>

<appSettings>

<add key="ConnectionString" value="Data Source=localhost;user id=sa;password=sa;initial catalog=DB"/>

</appSettings>

<connectionStrings/>

<system.web>

<httpHandlers>

<add verb="POST,GET" path="ajaxpro/*.ashx" type="AjaxPro.AjaxHandlerFactory, AjaxPro"/>

</httpHandlers>

<compilation debug="false" />

<authentication mode="Windows" />

</system.web>

</configuration>
5.sql脚本

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Photo]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)

drop table [dbo].[Photo]

GO

CREATE TABLE [dbo].[Photo] (

[id] [int] IDENTITY (1, 1) NOT NULL ,

[photo_title] [varchar] (128) COLLATE Chinese_PRC_CI_AS NULL ,

[photo_description] [text] COLLATE Chinese_PRC_CI_AS NULL ,

[photo_category_id] [int] NULL ,

[photo_path] [varchar] (255) COLLATE Chinese_PRC_CI_AS NULL

) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: