Ajax Slideshow Extender以空白幻灯片开始 - 帮助 [英] Ajax Slideshow Extender Starts with a blank Slide - HELP

查看:68
本文介绍了Ajax Slideshow Extender以空白幻灯片开始 - 帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Ajax幻灯片在开始时显示一个空白图像,我似乎无法弄清楚如何阻止它发生。文件夹中只有2个图像,但它似乎认为有3个。我认为我可能需要在页面加载上加载图像,或者强制该功能在页面加载时运行。

这是我的代码:

My Ajax Slideshow shows a blank image on start and I can't seem to figure out how to stop it from happening. There are only 2 images in the folder but it seem to think that there are 3. I think that I may need to have the image load on Page Load or maybe force the function to run on page load.
Here is my code:

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

    <cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </cc1:ToolkitScriptManager>
                <asp:Image ID="Image1" runat="server" Height="1615" Width="1050" ImageAlign="Top"/>             
                <cc1:SlideShowExtender ID="SlideShowExtender" runat="server" TargetControlID="Image1"

                    SlideShowServiceMethod="GetImages"

                    AutoPlay="true" PlayInterval="20000" Loop="True">
                </cc1:SlideShowExtender>
    </form>
    <p class="auto-style1"><span class="auto-style3"><strong style="font-size: 36px; font-weight: bold">Welcome to
 Center</strong></span></p>
</body>





和我的代码背后是:



and my code behind is this:

Imports System.IO
Imports AjaxControlToolkit
Imports System.Web.Services
Imports System.Web.Script.Services
Imports System.Collections.Generic

Partial Class Breakfast
    Inherits System.Web.UI.Page

    <WebMethod()> _
        <ScriptMethod()> _
    Public Shared Function GetImages() As Slide()
        Dim slides As New List(Of Slide)()
        Dim sPath As String = HttpContext.Current.Server.MapPath("~/ImagesLunch/")
        If sPath.EndsWith("\") Then
            sPath = sPath.Remove(sPath.Length - 1)
        End If
        Dim pathUri As New Uri(sPath, UriKind.Absolute)
        Dim files As String() = Directory.GetFiles(sPath)
        For Each file As String In files
            Dim filePathUri As New Uri(file, UriKind.Absolute)
            slides.Add(New Slide() With { _
              .Name = Path.GetFileNameWithoutExtension(file), _
              .Description = Path.GetFileNameWithoutExtension(file) + " Description.", _
              .ImagePath = pathUri.MakeRelativeUri(filePathUri).ToString() _
            })
        Next
        Return slides.ToArray()
    End Function

End Class

推荐答案

我弄清楚发生了什么。我没有检查文件夹中隐藏的操作系统文件。当我取消选中隐藏操作系统文件时,我在每个文件夹中找到了罪魁祸首,thumbs.db文件。我进入gpedit.msc并找到了禁用将thumbs.db文件放在文件夹中的密钥,并删除了所有图像文件夹中的所有thumbs.db文件。问题解决了,哇哇,我花了3个月的时间来解决这个问题。
I figured out what was happening. I had not checked the folder for hidden operating system files. When I unchecked to hide operating system files I found the culprit, thumbs.db file in each folder. I went into gpedit.msc and found the key to disable the placing of the thumbs.db file in the folder and deleted all the thumbs.db files from all my image folders. Problem solved, woohoo, it only took me 3 months to figure this out.


这篇关于Ajax Slideshow Extender以空白幻灯片开始 - 帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆