欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

ASP·NET頭條新聞顯示功能詳解

系統(tǒng) 1874 0

運行效果:

ASP·NET頭條新聞顯示功能詳解

前臺代碼:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TopNews222.aspx.cs" Inherits="web.TopNews222" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">

<html xmlns=" http://www.w3.org/1999/xhtml " >
<head runat="server">
<title>頭條新聞</title>
<!-- 圖片滾動 -->
<SCRIPT language="javascript">
var nn;
nn=2;
setTimeout('change_img()',4000);
function change_img()
{
if(nn>5) nn=1
setTimeout('setFocus1('+nn+')',4000);
nn++;
tt=setTimeout('change_img()',4000);
}
function setFocus1(i)
{
selectLayer1(i);
}
function selectLayer1(i)
{
switch(i)
{
case 1:
document.getElementById("focusPic1").style.display="block";
document.getElementById("focusPic2").style.display="none";
document.getElementById("focusPic3").style.display="none";
document.getElementById("focusPic4").style.display="none";
document.getElementById("focusPic5").style.display="none";
break;
case 2:
document.getElementById("focusPic1").style.display="none";
document.getElementById("focusPic2").style.display="block";
document.getElementById("focusPic3").style.display="none";
document.getElementById("focusPic4").style.display="none";
document.getElementById("focusPic5").style.display="none";
break;
case 3:
document.getElementById("focusPic1").style.display="none";
document.getElementById("focusPic2").style.display="none";
document.getElementById("focusPic3").style.display="block";
document.getElementById("focusPic4").style.display="none";
document.getElementById("focusPic5").style.display="none";
break;
case 4:
document.getElementById("focusPic1").style.display="none";
document.getElementById("focusPic2").style.display="none";
document.getElementById("focusPic3").style.display="none";
document.getElementById("focusPic4").style.display="block";
document.getElementById("focusPic5").style.display="none";
break;
case 5:
document.getElementById("focusPic1").style.display="none";
document.getElementById("focusPic2").style.display="none";
document.getElementById("focusPic3").style.display="none";
document.getElementById("focusPic4").style.display="none";
document.getElementById("focusPic5").style.display="block";
break;
}
}
</SCRIPT>
</head>
<body>
<table style="BORDER-RIGHT: #9ec9eb 1px solid; BORDER-TOP: #9ec9eb 1px solid; BORDER-LEFT: #9ec9eb 1px solid; BORDER-BOTTOM: #9ec9eb 1px solid"
height="434" width="611">
<tr>
<td>
<DIV id="ImgChangeMain">
<DIV id="focusPic1" style="DISPLAY: block"><A href="TopNews.aspx?TopId=1" target="_blank"><IMG height="369" src="topImg/1.jpg" width="611" border="0"></A>
<TABLE style="CLEAR: both; MARGIN: auto" cellSpacing="1" cellPadding="0" width="98%" align="right"
border="0">
<TBODY>
<TR align="center" bgColor="#9ec9ec">
<TD bgColor="#e2eaf7">&nbsp;</TD>
<TD style="COLOR: #ffffff" width="26" bgColor="#0049a5">1</TD>
<TD onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" style="CURSOR: pointer"
onclick="javascript:setFocus1(2)" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'"
width="26" bgColor="#9ec9ec">2</TD>
<TD onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" style="CURSOR: pointer"
onclick="javascript:setFocus1(3)" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'"
width="26" bgColor="#9ec9ec">3</TD>
<TD onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" style="CURSOR: pointer"
onclick="javascript:setFocus1(4)" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'"
width="26" bgColor="#9ec9ec">4</TD>
<TD onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" style="CURSOR: pointer"
onclick="javascript:setFocus1(5)" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'"
width="26" bgColor="#9ec9ec">5</TD>
</TR>
</TBODY>
</TABLE>
</DIV>
<DIV class="ImgChange1" id="focusPic2" style="DISPLAY: none"><A href="TopNews.aspx?TopId=2" target="_blank"><IMG height="369" src="topImg/2.jpg" width="611" border="0"></A>
<TABLE style="CLEAR: both; MARGIN: auto" cellSpacing="1" cellPadding="0" width="98%" align="right"
border="0">
<TBODY>
<TR align="center" bgColor="#9ec9ec">
<TD bgColor="#e2eaf7">&nbsp;</TD>
<TD onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" style="CURSOR: pointer"
onclick="javascript:setFocus1(1)" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'"
width="26" bgColor="#9ec9ec">1</TD>
<TD style="COLOR: #ffffff" width="26" bgColor="#0049a5">2</TD>
<TD onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" style="CURSOR: pointer"
onclick="javascript:setFocus1(3)" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'"
width="26" bgColor="#9ec9ec">3</TD>
<TD onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" style="CURSOR: pointer"
onclick="javascript:setFocus1(4)" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'"
width="26" bgColor="#9ec9ec">4</TD>
<TD onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" style="CURSOR: pointer"
onclick="javascript:setFocus1(5)" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'"
width="26" bgColor="#9ec9ec">5</TD>
</TR>
</TBODY>
</TABLE>
</DIV>
<DIV class="ImgChange1" id="focusPic3" style="DISPLAY: none"><A href="TopNews.aspx?TopId=3" target="_blank"><IMG height="369" src="topImg/3.jpg" width="611" border="0"></A>
<TABLE style="CLEAR: both; MARGIN: auto" cellSpacing="1" cellPadding="0" width="98%" align="right"
border="0">
<TBODY>
<TR align="center" bgColor="#9ec9ec">
<TD bgColor="#e2eaf7">&nbsp;</TD>
<TD onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" style="CURSOR: pointer"
onclick="javascript:setFocus1(1)" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'"
width="26" bgColor="#9ec9ec">1</TD>
<TD onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" style="CURSOR: pointer"
onclick="javascript:setFocus1(2)" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'"
width="26" bgColor="#9ec9ec">2</TD>
<TD style="COLOR: #ffffff" width="26" bgColor="#0049a5">3</TD>
<TD onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" style="CURSOR: pointer"
onclick="javascript:setFocus1(4)" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'"
width="26" bgColor="#9ec9ec">4</TD>
<TD onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" style="CURSOR: pointer"
onclick="javascript:setFocus1(5)" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'"
width="26" bgColor="#9ec9ec">5</TD>
</TR>
</TBODY>
</TABLE>
</DIV>
<DIV class="ImgChange1" id="focusPic4" style="DISPLAY: none"><A href="TopNews.aspx?TopId=4" target="_blank"><IMG height="369" src="topImg/4.jpg" width="611" border="0"></A>
<TABLE style="CLEAR: both; MARGIN: auto" cellSpacing="1" cellPadding="0" width="98%" align="right"
border="0">
<TBODY>
<TR align="center" bgColor="#9ec9ec">
<TD bgColor="#e2eaf7">&nbsp;</TD>
<TD onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" style="CURSOR: pointer"
onclick="javascript:setFocus1(1)" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'"
width="26" bgColor="#9ec9ec">1</TD>
<TD onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" style="CURSOR: pointer"
onclick="javascript:setFocus1(2)" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'"
width="26" bgColor="#9ec9ec">2</TD>
<TD onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" style="CURSOR: pointer"
onclick="javascript:setFocus1(3)" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'"
width="26" bgColor="#9ec9ec">3</TD>
<TD style="COLOR: #ffffff" width="26" bgColor="#0049a5">4</TD>
<TD onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" style="CURSOR: pointer"
onclick="javascript:setFocus1(5)" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'"
width="26" bgColor="#9ec9ec">5</TD>
</TR>
</TBODY>
</TABLE>
</DIV>
<DIV class="ImgChange1" id="focusPic5" style="DISPLAY: none"><A href="TopNews.aspx?TopId=5" target="_blank"><IMG height="369" src="topImg/5.jpg" width="611" border="0"></A>
<TABLE style="CLEAR: both; MARGIN: auto" cellSpacing="1" cellPadding="0" width="98%" align="right"
border="0">
<TBODY>
<TR align="center" bgColor="#9ec9ec">
<TD bgColor="#e2eaf7">&nbsp;</TD>
<TD onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" style="CURSOR: pointer"
onclick="javascript:setFocus1(1)" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'"
width="26" bgColor="#9ec9ec">1</TD>
<TD onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" style="CURSOR: pointer"
onclick="javascript:setFocus1(2)" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'"
width="26" bgColor="#9ec9ec">2</TD>
<TD onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" style="CURSOR: pointer"
onclick="javascript:setFocus1(3)" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'"
width="26" bgColor="#9ec9ec">3</TD>
<TD onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" style="CURSOR: pointer"
onclick="javascript:setFocus1(4)" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'"
width="26" bgColor="#9ec9ec">4</TD>
<TD style="COLOR: #ffffff" width="26" bgColor="#0049a5">5</TD>
</TR>
</TBODY>
</TABLE>
</DIV>
</DIV> <!--ImgChangeMain End--></td>
</tr>
</table>
<form id="form1" runat="server">
<div>

</div>
</form>
</body>
</html>

TopNews.aspx前臺代碼:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TopNews.aspx.cs" Inherits="fashionArea_TopNews" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">

<html xmlns=" http://www.w3.org/1999/xhtml " >
<head runat="server">
<title>頭條新聞</title>
</head>

<body>
<form id="form1" runat="server">
<table width="865" height="211" align="center" cellpadding="0" cellspacing="0" style="border-right: #9ec9eb 1px solid;
border-top: #9ec9eb 1px solid; border-left: #9ec9eb 1px solid; padding-top: 4px;
border-bottom: #9ec9eb 1px solid">
<tr>
<td height="10" width="760">
</td>
</tr>
<tr>
<td id="Title" runat="server" align="center" height="30" style="font-weight: bold; font-size: larger">
</td>
</tr>
<tr>
<td id="newContent" runat="server" style="padding-right: 10px; padding-left: 10px; height: 26px; text-indent: 2em;">
</td>
</tr>
</table>

</form>
</body>
</html>

TopNews.aspx后臺代碼:

protected void Page_Load(object sender, EventArgs e)
{
string TopId = Request.QueryString["TopId"];

SqlConnection conn = new SqlConnection("Data Source=.;User ID=sa;Password=123;Initial Catalog=kxjm_DB");
conn.Open();
SqlCommand command = new SqlCommand("select * from news where id='" + TopId + "'", conn);
SqlDataReader reader = command.ExecuteReader();

while (reader.Read())
{
Title.InnerText = reader[1].ToString();
newContent.InnerHtml = reader[2].ToString();

}
conn.Close();
command.Dispose();
}

ASP·NET頭條新聞顯示功能詳解


更多文章、技術交流、商務合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯(lián)系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發(fā)表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 亚洲高清在线播放 | 国产限制级在线 | 九九影院理论片 | 性色av免费在线观看 | 久一在线视频 | 丁香午夜 | 热久久国产| 黄视频欧美 | 日韩成人中文字幕 | 欧美精品激情 | 一区日韩| 好骚综合97op | 亚洲AV久久无码精品九号 | 国产福利视频一区美女 | 九九久久九九久久 | 国产一级电影网 | heyzo欧美| 日韩成人在线视频 | 日韩成人免费视频 | 一区二区播放 | 色洛色中文综合网站 | 777奇米视频 | 黄色一级视频网站 | 国产区小视频 | 欧美一级毛片在线看视频 | 夜夜爽99久久国产综合精品女不卡 | 毛片毛片毛片毛片毛片毛片毛片 | 一级高清视频www | 91在线视频播放 | 99热热99| 太平公主一级艳史播放高清 | 日本高清免费h色视频在线观看 | 欧美在线观看a | 黄片毛片免费观看 | 国产精品毛片一区二区三区 | 色片免费在线观看 | 日本污网站 | 日韩在线观看视频一区二区三区 | 五月天激激婷婷大综合蜜芽 | 国产一级免费不卡 | 久久黄视频 |