幻灯片从ASP.net到SP2007

时间:2011-06-20 16:33:23

标签: web-services sharepoint sharepoint-2007 asp.net-ajax

我有一项任务是将以下ASP.Net幻灯片转换为SharePoint 2007,我想知道是否有人可以提供一些指导如何最有效地完成它。我的SP环境是一个小型SQL + Web / SP服务器。我已经构建了一小部分自定义数据驱动的Web部件,因此我知道如何开发和发布。我遇到的困难是,此示例应用程序使用的Web服务以及如何使其在SP中运行,具体来说,如何访问包含成员不同的图像的自定义列表。 这是aspx文件的样子:

<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
CodeBehind="Default.aspx.cs" Inherits="WebApplication3._Default" %>

&lt;%@ Register Assembly =“AjaxControlToolkit”Namespace =“AjaxControlToolkit”TagPrefix =“asp”%&gt;

    

       幻灯片放映示例     

    

               

<div style="text-align: center;" >   
    <asp:Image ImageUrl="images/Slide1.JPG" ID="Image1" runat="server" alt="image" height="300" Width="450"/>
    <br />
    <asp:Button ID="prevButton" runat="server" Text="Prev" />
    <asp:Button ID="playButton" runat="server" Text="Play" />
    <asp:Button ID="nextButton" runat="server" Text="Next" />

    <asp:SlideShowExtender
        ID="SlideShowExtender1" runat="server"    
        TargetControlID="Image1"    
        SlideShowServiceMethod="GetSlides"
        SlideShowServicePath="SlideShowService.asmx"
        AutoPlay="true"   
        PlayInterval="4000"
        NextButtonID="nextButton"
        PlayButtonID="PlayButton"
        PlayButtonText="Play"
        StopButtonText="Stop"
        PreviousButtonID="prevButton"

        Loop="true" />
</div>
</p>

...和网络服务:

命名空间WebApplication3 {     [WebService(Namespace =“http://microsoft.com/webservices/”)]     [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]     [System.ComponentModel.ToolboxItem(假)]     [System.Web.Script.Services.ScriptService()]     公共类SlideShowService:System.Web.Services.WebService     {

    [WebMethod]
    public AjaxControlToolkit.Slide[] GetSlides()
    {
        AjaxControlToolkit.Slide[] MySlides = new AjaxControlToolkit.Slide[10];

        MySlides[0] = new AjaxControlToolkit.Slide("images/Slide1.JPG", "Slide1", "Slide1");
        MySlides[1] = new AjaxControlToolkit.Slide("images/Slide2.JPG", "Slide2", "Slide2");
        MySlides[2] = new AjaxControlToolkit.Slide("images/Slide3.JPG", "Slide3", "Slide3");
        MySlides[3] = new AjaxControlToolkit.Slide("images/Slide4.JPG", "Slide4", "Slide4");
        MySlides[4] = new AjaxControlToolkit.Slide("images/Slide5.JPG", "Slide5", "Slide5");
        MySlides[5] = new AjaxControlToolkit.Slide("images/Slide6.JPG", "Slide6", "Slide6");
        MySlides[6] = new AjaxControlToolkit.Slide("images/Slide7.JPG", "Slide7", "Slide7");
        MySlides[7] = new AjaxControlToolkit.Slide("images/Slide8.JPG", "Slide8", "Slide8");
        MySlides[8] = new AjaxControlToolkit.Slide("images/Slide9.JPG", "Slide9", "Slide9");
        MySlides[9] = new AjaxControlToolkit.Slide("images/Slide10.JPG", "Slide10", "Slide10");


        return MySlides;
    }
}

}

提前致谢!祝你有美好的一天。

Risho

0 个答案:

没有答案