C# 动态的创建控件
intdata_a=0;while(data_a<5){temp="oDIV"+(data_a++).ToString();Response.Write(temp);}m...
int data_a = 0;
while (data_a < 5)
{
temp = "oDIV" + (data_a++).ToString();
Response.Write(temp);
}
myConn.Open();
myCmd = new SqlCommand("select top 5 * from flash", myConn);
SqlDataReader dr1 = myCmd.ExecuteReader();
while (dr1.Read())
{
pics = dr1["pics"].ToString();
links = dr1["links"].ToString();
}
dr1.Close();
myConn.Close();
上述是cs代码
<table width="778" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> <div id=oTransContainer
style="FILTER: progid:DXImageTransform.Microsoft.Wipe(GradientSize=1.0,wipeStyle=0, motion='forward'); WIDTH: 165px; HEIGHT: 103px"><a href="http://www.lanrentuku.com/" target="_blank"><img class=pic id=oDIV1 src="images/01.jpg" width=788 height=150>
<script>var NowFrame = 1;var MaxFrame = 6;var bStart = 0;function fnToggle(){var next = NowFrame + 1;if(next == MaxFrame+1) {NowFrame = MaxFrame;next = 1;}if(bStart == 0){bStart = 1;setTimeout('fnToggle()', 2000);return;}else{oTransContainer.filters[0].Apply();document.images['oDIV'+next].style.display = "";document.images['oDIV'+NowFrame].style.display = "none";oTransContainer.filters[0].Play(duration=2);if(NowFrame == MaxFrame){NowFrame = 1;}else{NowFrame++;}} setTimeout('fnToggle()', 6000);}fnToggle();</script>
</a>
<a href="http://www.lanrentuku.com/" target="_blank"><img class=pic id=oDIV2 src="images/02.jpg" width=788 height=150 style="DISPLAY: none;"></a>
<a href="http://www.lanrentuku.com/" target="_blank"><img class=pic id=oDIV3 src="images/03.jpg" width=788 height=150 style="DISPLAY: none;"></a>
<a href="http://www.lanrentuku.com/" target="_blank"><img class=pic id=oDIV4 src="images/04.jpg" width=788 height=150 style="DISPLAY: none;"></a>
<a href="http://www.lanrentuku.com/" target="_blank"><img class=pic id=oDIV5 src="images/05.jpg" width=788 height=150 style="DISPLAY: none;"></a>
<a href="http://websky18.com/d/file/gamekf/2010-02-26/a9428e5d3d369c38459296708a9f8022.gif" target="_blank"><img class=pic id=oDIV6 src="http://websky18.com/d/file/gamekf/2010-02-26/a9428e5d3d369c38459296708a9f8022.gif" width=788 height=150 style="DISPLAY: none;"></a>
</div></td>
</tr>
</table>
上述是网站我想要的效果!请问大家怎么做出来呢? 展开
while (data_a < 5)
{
temp = "oDIV" + (data_a++).ToString();
Response.Write(temp);
}
myConn.Open();
myCmd = new SqlCommand("select top 5 * from flash", myConn);
SqlDataReader dr1 = myCmd.ExecuteReader();
while (dr1.Read())
{
pics = dr1["pics"].ToString();
links = dr1["links"].ToString();
}
dr1.Close();
myConn.Close();
上述是cs代码
<table width="778" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> <div id=oTransContainer
style="FILTER: progid:DXImageTransform.Microsoft.Wipe(GradientSize=1.0,wipeStyle=0, motion='forward'); WIDTH: 165px; HEIGHT: 103px"><a href="http://www.lanrentuku.com/" target="_blank"><img class=pic id=oDIV1 src="images/01.jpg" width=788 height=150>
<script>var NowFrame = 1;var MaxFrame = 6;var bStart = 0;function fnToggle(){var next = NowFrame + 1;if(next == MaxFrame+1) {NowFrame = MaxFrame;next = 1;}if(bStart == 0){bStart = 1;setTimeout('fnToggle()', 2000);return;}else{oTransContainer.filters[0].Apply();document.images['oDIV'+next].style.display = "";document.images['oDIV'+NowFrame].style.display = "none";oTransContainer.filters[0].Play(duration=2);if(NowFrame == MaxFrame){NowFrame = 1;}else{NowFrame++;}} setTimeout('fnToggle()', 6000);}fnToggle();</script>
</a>
<a href="http://www.lanrentuku.com/" target="_blank"><img class=pic id=oDIV2 src="images/02.jpg" width=788 height=150 style="DISPLAY: none;"></a>
<a href="http://www.lanrentuku.com/" target="_blank"><img class=pic id=oDIV3 src="images/03.jpg" width=788 height=150 style="DISPLAY: none;"></a>
<a href="http://www.lanrentuku.com/" target="_blank"><img class=pic id=oDIV4 src="images/04.jpg" width=788 height=150 style="DISPLAY: none;"></a>
<a href="http://www.lanrentuku.com/" target="_blank"><img class=pic id=oDIV5 src="images/05.jpg" width=788 height=150 style="DISPLAY: none;"></a>
<a href="http://websky18.com/d/file/gamekf/2010-02-26/a9428e5d3d369c38459296708a9f8022.gif" target="_blank"><img class=pic id=oDIV6 src="http://websky18.com/d/file/gamekf/2010-02-26/a9428e5d3d369c38459296708a9f8022.gif" width=788 height=150 style="DISPLAY: none;"></a>
</div></td>
</tr>
</table>
上述是网站我想要的效果!请问大家怎么做出来呢? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询