c#.net Dynamic read Merry-go Code instance sharing _ Practical tips

Source: Internet
Author: User

Foreground HTML and JS script:

[HTML]

Copy Code code as follows:

<div>
<table border= "0" cellpadding= "0" cellspacing= "0" >
<tr>
&LT;TD bgcolor= "#CC66FF"
Style= "width:990px; height:5px; Background-color: #ffffff; Text-align:center; " >
</td>
</tr>
<tr>
&LT;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>
&LT;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>
&LT;TD id= "Demo1" valign= "Top" >
<table border= "0" cellpadding= "0" cellspacing= "0" width= ">"
<tr> <asp:label id= "Label1" runat= "Server" text= "Label" ></asp:Label>
</tr>

</table>
</td>
&LT;TD id= "Demo2" valign= "Top" >
</td>
</tr>
</table>
</div>
<script __designer:dtid= "3377854339350821" >
var speed3=1//speed is more slow
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>
&LT;TD style= "width:100px; height:5px ">
</td>
</tr>
</table>
</div>

Code for CS Page:

[CSharp]

Copy Code code as follows:

Dal_collection dc = new Dal_collection ();
Label1.Text = DC. Getindexzoumadeng ();

Code for Dal_collection.getindexzoumadeng ():


[CSharp]
Copy Code code as follows:

Using System.Text;

[CSharp]

Copy Code code as follows:

public string Getindexzoumadeng ()
{

StringBuilder res = new StringBuilder ();
DataTable dt0 = Getnewspagedb ("Select Top cn_id, cn_title,cn_intro,cn_url,cn_uid,cn_times to 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 ();
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.