p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.

Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 5th, 2006, 06:35 AM
Authorized User
 
Join Date: Nov 2005
Location: mumbai, maharashtra, India.
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default using javascript ticker in asp.net c#

hello everybody,

this is the link
http://news.bbc.co.uk/
 as see this there is newsbar that is displaying the latest news
i want to do the same have the javascript for this but i want this script to acess database and display the latest data...

here is the html


<HTML>
<HEAD>
<title></title>
<meta http-equiv="content-type" ontent="text/html;charset=iso-8859-1">
</HEAD>
<body>
  <div class="ticki"><a class="tickl" id="tickerAnchor" style="TEXT-DECORATION: none" href="http://news.bbc.co.uk/" target="_top">
<span class="tickls">LATEST:&nbsp;</span></a></div>
<script language="JavaScript" type="text/javascript">
<!--
// Ticker startup
function startTicker()
{

    // Define run time values
    theCurrentStory = -1;
    theCurrentLength = 0;
    // Locate base objects
    if (document.getElementById)
        {
     theAnchorObject = document.getElementById("tickerAnchor");
     runTheTicker();
        }
    else
        { document.write("<style>.ticki{display:none;}.ticko {border:0px; padding:0px;}</style>");
            return true;
    }
}
// Ticker main run loop
function runTheTicker()
{
    var myTimeout;
    // Go for the next story data block
    if(theCurrentLength == 0)
    {
        theCurrentStory++;
        theCurrentStory = theCurrentStory % theItemCount;
        theStorySummary = theSummaries[theCurrentStory].replace(/&quot;/g,'"');
        theTargetLink = theSiteLinks[theCurrentStory];
        theAnchorObject.href = theTargetLink;
        thePrefix = "<span class=\"tickls\">" + theLeadString + "</span>";
    }
    // Stuff the current ticker text into the anchor
    theAnchorObject.innerHTML = thePrefix +
    theStorySummary.substring(0,theCurrentLength) + whatWidget();
    // Modify the length for the substring and define the timer
    if(theCurrentLength != theStorySummary.length)
    {
        theCurrentLength++;
        myTimeout = theCharacterTimeout;
    }
    else
    {
        theCurrentLength = 0;
        myTimeout = theStoryTimeout;
    }
    // Call up the next cycle of the ticker
    setTimeout("runTheTicker()", myTimeout);
}
// Widget generator
function whatWidget()
{
    if(theCurrentLength == theStorySummary.length)
    {
        return theWidgetNone;
    }

    if((theCurrentLength % 2) == 1)
    {
        return theWidgetOne;
    }
    else
    {
        return theWidgetTwo;
    }
}
// -->
        </script>
        <script language="JavaScript" type="text/javascript">
    <!--

    var theCharacterTimeout = 50;
    var theStoryTimeout = 5000;
    var theWidgetOne = "_";
    var theWidgetTwo = "-";
    var theWidgetNone = "";
    var theLeadString = "Recent:&nbsp;";

    var theSummaries = new Array();
    var theSiteLinks = new Array();
    var theItemCount = 4;


theSummaries[0] = "School students in Chile reject government offer aimed at ending protests.";
theSiteLinks[0] = "/2/hi/americas/5042758.stm";

theSummaries[1] = "Canadian police arrest at least 10 in anti-terror operation in Toronto.";
theSiteLinks[1] = "/2/hi/americas/5043408.stm";

theSummaries[2] = "Seven members of same family shot dead during apparent robbery in Indianapolis.";
theSiteLinks[2] = "/2/hi/americas/5043056.stm";

theSummaries[3] = "A cannabis plant extract provides pain relief after major surgery, research shows.";
theSiteLinks[3] = "/2/hi/health/5040960.stm";

startTicker();

//-->
</script>
</body>


how do i integrate this with my code behind to pass array values from database

Thanks and Regards,
vivek soni

Best Regards,
Vivek.
__________________
Best Regards,
Vivek.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old June 5th, 2006, 01:07 PM
Friend of Wrox
Points: 4,166, Level: 27
Points: 4,166, Level: 27 Points: 4,166, Level: 27 Points: 4,166, Level: 27
Activity: 12%
Activity: 12% Activity: 12% Activity: 12%
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,328
Thanks: 0
Thanked 1 Time in 1 Post
Default

Do not post the same topic in multiple forums:
http://p2p.wrox.com/topic.asp?TOPIC_ID=45227

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
using javascript ticker in asp.net vivek_inos ASP.NET 1.0 and 1.1 Professional 1 June 5th, 2006 01:05 PM
using javascript ticker in asp.net vivek_inos ASP.NET 1.x and 2.0 Application Design 0 June 5th, 2006 06:29 AM
is it possible to use javascript+asp.net ? FlyingBear BOOK: Professional Ajax ISBN: 978-0-471-77778-6 1 April 28th, 2006 03:44 AM
javascript to asp.net bimboypogi ASP.NET 1.0 and 1.1 Professional 2 March 21st, 2005 02:49 AM
javascript in asp.net pran ASP.NET 1.1 11 September 20th, 2004 10:37 AM



All times are GMT -4. The time now is 04:59 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc