欧美三区_成人在线免费观看视频_欧美极品少妇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條評論
主站蜘蛛池模板: 欧美激情啪啪 | 欧美卡一卡二卡新区网站 | 亚洲午夜精品视频 | 在线国产一区二区 | 青草草在线观看免费视频 | www.久久99 | 国产精品一区二 | 一级片网 | 精品一二三区 | 黄色激情网站 | 欧美一级黄色网 | 在线观看av片 | 国产成人高清视频 | 日韩网红少妇无码视频香港 | 亚洲综合色视频在线观看 | 青娱乐手机免费视频 | 日本特黄特色大片免费视频 | 人人看人人插 | 国内真实迷j下药在线观看 人人艹逼 | 91国在线国内在线播放 | 亚洲人成在线精品 | 欧美一级毛片不卡免费观看 | 亚洲视频免费在线 | 三级黄色网址 | 美女久久久久久久久久久 | 中文字幕 国产 | 久久日本精品一区二区三区 | 国内精品久久久久久中文字幕 | 99久久精品免费观看区一 | 成人福利在线视频 | 九色网址 | 欧美成人二区 | 麻豆hd| 日韩免费在线观看视频 | 国产精品视频1区 | 亚洲毛片无码专区亚洲A片 日本高清www午色夜黄 | 久久久久久影院 | 蜜桃av人人夜夜澡人人爽 | 老司机午夜免费精品视频 | 在线欧美日韩 | 夜夜操天天射 |