当前位置:编程学习 > C#/ASP.NET >>

关于slideshowextender控件的疑问

请问,为什么我下面的代码不能成功显示图片呢?
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<!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 runat="server">
    <title></title>
</head>
<body>

    <form id="form1" runat="server">
    <div>
    
    </div>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
<br />
<br />
<br />
<br />
            <asp:Image ID="Image1" runat="server" />
            <cc1:SlideShowExtender ID="Image1_SlideShowExtender" runat="server" 
                TargetControlID="Image1"
                NextButtonID="Button1"
                PreviousButtonID="Button2"
                PlayButtonID="Button3"
                SlideShowServicePath="PhotoService.asmx"
                SlideShowServiceMethod="GetPhoto"
                >
            </cc1:SlideShowExtender>
            <br />
<br />
            <br />
            <br />
            <asp:Button ID="Button1" runat="server" Text="Button" />
            <asp:Button ID="Button2" runat="server" Text="Button" />
            <asp:Button ID="Button3" runat="server" Text="Button" />
            <br />
            <br />
            <br />
            <br />
        </ContentTemplate>
    </asp:UpdatePanel>
    

    <asp:Image ID="Image2" runat="server" ImageUrl="1.gif" />
    

    </form>
</body>
</html>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;

/// <summary>
///PhotoService 的摘要说明
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
//若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消对下行的注释。 
// [System.Web.Script.Services.ScriptService]
public class PhotoService : System.Web.Services.WebService {

    public PhotoService () {

        //如果使用设计的组件,请取消注释以下行 
        //InitializeComponent(); 
    }

    [WebMethod]
    public AjaxControlToolkit.Slide[] GetPhoto()
    {
        return new AjaxControlToolkit.Slide[] {
            new AjaxControlToolkit.Slide("1.gif","hii","weq"),
            new AjaxControlToolkit.Slide("2.gif","da","asdasd"),
    };
    }

    
}
补充:.NET技术 ,  ASP.NET
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,