Results 1 to 3 of 3

Thread: [RESOLVED] [2008] SlideShowExtender in ContentPlaceHolder

  1. #1

    Thread Starter
    Registered User nmadd's Avatar
    Join Date
    Jun 2007
    Location
    U.S.A.
    Posts
    1,676

    Resolved [RESOLVED] [2008] SlideShowExtender in ContentPlaceHolder

    I'm having trouble getting the SlideShowExtender working in a ContentPlaceHolder. The extender works fine when I try it on a test page with no Master Page but does not when I use it on a Web Content Form with a Master Page. The code is exactly the same on both my test page and the ContentPlaceHolder page.

    Code:
    1        <asp:ScriptManager ID="ScriptManager1" runat="server">
    2        </asp:ScriptManager>
    3        <asp:Image ID="galleryImage" runat="server" />
    4            <cc1:SlideShowExtender ID="SlideShowExtender1" runat="server"
    5                TargetControlID="galleryImage"
    6                PreviousButtonID="prevButton"
    7                NextButtonID="nextButton"
    8                SlideShowServicePath="~/SlideService.asmx"
    9                SlideShowServiceMethod="GetSlides"
    10               ContextKey="advertising/coors">
    11           </cc1:SlideShowExtender>
    12           <asp:ImageButton ID="prevButton" runat="server" ImageUrl="~/images/leftarrow.gif" />
    13           <asp:ImageButton ID="nextbutton" runat="server" ImageUrl="~/images/rightarrow.gif" />
    My Web Service:
    Code:
    1        <WebMethod()> _
    2        Public Function GetSlides(ByVal contextKey As String) As AjaxControlToolkit.Slide()
    3    
    4            Dim count As Integer = Directory.GetFiles(Server.MapPath("~/images/" & contextKey)).Count
    5            Dim slides(count - 1) As AjaxControlToolkit.Slide
    6            Dim files() As String = Directory.GetFiles(Server.MapPath("~/images/" & contextKey))
    7    
    8            For i As Integer = 0 To files.GetUpperBound(0) Step 1
    9                slides(i) = New AjaxControlToolkit.Slide()
    10               slides(i).ImagePath = "images/" & contextKey & "/" & Path.GetFileName(files(i))
    11           Next i
    12   
    13           Return slides
    14   
    15       End Function
    Why can I get this to work in a regular old ASPX page, but not inside of a ContentPlaceHolder on a page that uses a Master Page? Thanks.

    EDIT: I should note that I don't receive any error and stepping through the code everything looks like it is working.
    Last edited by nmadd; Aug 18th, 2008 at 09:18 AM.

  2. #2

    Thread Starter
    Registered User nmadd's Avatar
    Join Date
    Jun 2007
    Location
    U.S.A.
    Posts
    1,676

    Re: [2008] SlideShowExtender in ContentPlaceHolder

    OK, so it is not in fact the MasterPage/ContentPlaceHolder that is the problem. It appears that it is the location of the page. That is, it works if I have the page at http://mysite/Page.aspx but does NOT work if I have the page in a subdirectory at http://mysite/subdirectory/Page.aspx.

    I imagine I'm missing some property but I don't know what it is. Thanks for any help.

  3. #3

    Thread Starter
    Registered User nmadd's Avatar
    Join Date
    Jun 2007
    Location
    U.S.A.
    Posts
    1,676

    Re: [2008] SlideShowExtender in ContentPlaceHolder

    It dawned on me in the middle of the night that perhaps my ImagePath for my slides is wrong - and it appears that it is. No leading "/" to get to the root dir. I'll have to give this a shot when I get home.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width