Front-end html and js scripts:
[Html]
<Div>
<Table border = "0" cellpadding = "0" cellspacing = "0">
<Tr>
<Td bgcolor = "# CC66FF"
Style = "WIDTH: 990px; HEIGHT: 5px; BACKGROUND-COLOR: # ffffff; text-align: center;">
</Td>
</Tr>
<Tr>
<Td style = "BORDER-RIGHT: # cccc99 1px solid; BORDER-TOP: # cccc99 1px solid; BORDER-LEFT: # cccc99 1px solid; WIDTH: 990px; BORDER-BOTTOM: # cccc99 1px solid ">
<Table border = "0" cellpadding = "0" cellspacing = "0">
<Tr>
<Td style = "WIDTH: 990px; BACKGROUND-COLOR: # ffffff">
<Div style = "WIDTH: 990px; HEIGHT: 139px">
<Div id = "demo"
Style = "PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; OVERFLOW: hidden; WIDTH: 100%; COLOR: # ffffff; PADDING-TOP: 0px ">
<Table align = "left" border = "0" cellpadding = "0" cellspace = "0" cellspacing = "0"
Style = "WIDTH: 900px; HEIGHT: 139px">
<Tr>
<Td id = "demo1" valign = "top">
<Table border = "0" cellpadding = "0" cellspacing = "0" width = "2000">
<Tr> <asp: Label ID = "Label1" runat = "server" Text = "Label"> </asp: Label>
</Tr>
</Table>
</Td>
<Td id = "demo2" valign = "top">
</Td>
</Tr>
</Table>
</Div>
<SCRIPT _ designer: dtid = "3377854339350821">
Var speed3 = 1 // The greater the speed, the slower the speed.
Demo2.innerHTML = demo1.innerHTML
Function Marquee (){
If (demo2.offsetWidth-demo. scrollLeft <= 0)
Demo. scrollLeft-= demo1.offsetWidth
Else {
Demo. scrollLeft ++
}
}
Var MyMar = setInterval (Marquee, speed3)
Demo. onmouseover = function () {clearInterval (MyMar )}
Demo. onmouseout = function () {MyMar = setInterval (Marquee, speed3 )}
</SCRIPT>
</Div>
</Td>
</Tr>
</Table>
</Td>
</Tr>
<Tr>
<Td style = "WIDTH: 100px; HEIGHT: 5px">
</Td>
</Tr>
</Table>
</Div>
Code on the cs page:
[Csharp]
Dal_Collection dc = new dal_Collection ();
Label1.Text = dc. GetIndexZouMaDeng ();
Dal_Collection.GetIndexZouMaDeng () code:
[Csharp]
<P> using System. Text; </p>
[Csharp] view plaincopy
[Csharp] view plaincopy
Public string GetIndexZouMaDeng ()
{
StringBuilder res = new StringBuilder ();
DataTable dt0 = GetNewsPageDB ("select top 10 CN_Id, CN_Title, CN_Intro, CN_Url, CN_Uid, CN_Times from Collection order by CN_Times desc ");
If (dt0.Rows. Count = 0)
{
Res. Append ("no relevant data! ");
}
Else
{
For (int I = 0; I <dt0.Rows. Count; I ++) // see [NOTE 1]
{
Res. append ("<td align = \" center \ "height = \" 139 \ "width = \" 184 \ "> </td> ");
}
If (dt0.Rows. Count <= 6)
{
Res. Append (res. ToString ());
}
}
Return res. ToString ();
}