Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6085467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:38:31+00:00 2026-05-23T11:38:31+00:00

I’m still trying to figure out this slideshow task that I need to display

  • 0

I’m still trying to figure out this slideshow task that I need to display in a SharePoint 2007. In my other post folks suggested doing things that are more challenging that I’m not willing or have skills to take on. So what I have here is perhaps a simpler solution but it’s not working either.

I’m using a content editor web part into which I copied the code that works in a stand alone web site but not here.

I was hoping you can tell me if this can work and suggest a fix or should I just scrap it all toghether and take on the prior challenge.

In the default.master I have Javascript like this:

<script language="javascript" type="text/javascript">
<!--
var slideimages=new Array()
var slidelinks=new Array()
function slideshowimages(){
  for (i=0;i<slideshowimages.arguments.length;i++){
    slideimages[i]=new Image()
    slideimages[i].src=slideshowimages.arguments[i]
  }
}

function slideshowlinks(){
  for (i=0;i<slideshowlinks.arguments.length;i++)
    slidelinks[i]=slideshowlinks.arguments[i]
}

function gotoshow(){
  if (!window.winslide||winslide.closed)
    winslide=window.open(slidelinks[whichlink])
  else
    winslide.location=slidelinks[whichlink]
  winslide.focus()
}               
//-->

Then in content editor web part I have this:

<script runat="server" >

protected void Page_Load(object sender, EventArgs e)
{        
    int iCounter = 0;
    string path = Server.MapPath("/Bulletin/");

    System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(path);
    System.IO.FileInfo[] slides = di.GetFiles("*.jpg");
    iCounter = slides.Length;

    string mystring = string.Empty; 

    int i = 0;
    foreach (System.IO.FileInfo file in slides)
    {
        if (i < iCounter-1)
        {
            mystring += "'/Bulletin/" + slides[i].ToString() + "',";
            i++;
        }
        else
        {
            mystring += "'/Bulletin/" + slides[i].ToString() + "'";
        }
    }

    String scriptString = @"<script language=JavaScript>";

    scriptString += @"slideshowimages(" + mystring + @")
        slideshowlinks() // Still need to build this up
        var slideshowspeed = 10000
        var whichlink = 0
        var whichimage = 0
        function slideit() {
        if (!document.images)
        return
        document.images.slide.src = slideimages[whichimage].src
        whichlink = whichimage
        if (whichimage < slideimages.length - 1)
        whichimage++
        else
        whichimage = 0
        setTimeout('slideit()', slideshowspeed)
        }
        slideit()
         ";
   scriptString += @"</";
   scriptString += @"script>";

    if (!this.IsStartupScriptRegistered("clientScript"))
        this.RegisterStartupScript("clientScript", scriptString.ToString());
}

I have tried placing everything in the webpart. I have also placed the JavaScript in its own file, placed in a script directory in the root of my app and call it like that. I have also copied in the /_layout/1033 directory but none of these steps helped.

Thank you for your time!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T11:38:31+00:00Added an answer on May 23, 2026 at 11:38 am

    <script runat="server" >
    You cannot execute server side code in content edit web part.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I need a function that will clean a strings' special characters. I do NOT
In my XML file chapters tag has more chapter tag.i need to display chapters
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.