⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 newsshow.aspx

📁 ASP_NET程序设计教程 源代码 冶金工业出版社 肖金秀 冯沃辉 陈少涌
💻 ASPX
字号:
<% @ Import Namespace="Packaging" %>
<% @ Import Namespace="System.Data" %>
<% @ Register TagPrefix="pb" TagName="Header" Src="header.ascx" %>
<% @ Register TagPrefix="pb" TagName="Footer" Src="footer.ascx" %>
<% @ Register TagPrefix="pb" TagName="Login" Src="login.ascx" %>
<% @ Register TagPrefix="pb" TagName="Major" Src="major.ascx" %>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Content-Language" content="zh-cn">
<title><asp:Literal id="dtitle" runat="server" /></title>
<script language="JavaScript">
<!--
function openwin(url,w,h) {
	window.open(url,"","top=50,left=150,height="+h+",width="+w+",toolbar=0,location=0,directories=0,menubar=0,scrollbars=0,resizable=yes,status=0");
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->
</script>
<link rel="stylesheet" type="text/css" href="pack.css">
</head>

<body topmargin="6" leftmargin="0" bgcolor="#eaeaea">

<form runat="server">

<pb:Header id="Header" runat="server" />

<div align="center">
<table border="0" cellpadding="0" cellspacing="1" bgColor="#006699" width="750" height="125">
	<tr><td width="25%" valign="top" background="images/bd.gif" rowspan="2" height="125">
	<pb:Login id="login" runat="server" />
	<pb:Major id="major" runat="server" /></td>
	<td width="75%" valign="top" bgcolor="#FFFFFF" background="images/ldb.gif">

<asp:Repeater id="content" runat="server">
	<ItemTemplate>
	&nbsp;<br>&nbsp;
	<b><font color="#00A71C"><%# DataBinder.Eval(Container.DataItem, "NewsTitle") %></font></b><br>  
	<img border="0" src="images/line.gif" width="400" height="12"><br>
	发表时间:<%# DataBinder.Eval(Container.DataItem, "NewsTime") %>&nbsp; 
	点数:<%# DataBinder.Eval(Container.DataItem, "NewsClicks") %><br>  
	&nbsp;
	<table border="0" cellpadding="0" cellspacing="0" width="90%" align="center">
		<tr><td width="100%">
<%# DataBinder.Eval(Container.DataItem, "NewsContent") %>
		<tr><td width="100%">&nbsp;</td></tr>
		<tr><td width="100%" onMouseOver="javascript:this.style.color='#00A71C'" onMouseOut="javascript:this.style.color='#000000'">
		<hr color="#00A71C" width="30%" size="1" align="left">
		编辑:<%# DataBinder.Eval(Container.DataItem, "NewsAuthor") %><br>
		出自:[<%# DataBinder.Eval(Container.DataItem, "NewsFrom") %>]</td></tr>
	</table>
	</ItemTemplate>
</asp:Repeater>
<asp:Label id="errormsg" runat="server"
text="<br>警告:你正在试图打开一个不存在的文章!" style="color=red" visible="false" />

	</td><tr>
	<td width="75%" valign="bottom" bgcolor="#FFFFFF" height="80" align="right" background="images/ldb.gif">
	<img border="0" src="images/pen.gif" width="400" height="80"><br>&nbsp;</td></tr>
</table>
</div>

<pb:Footer id="footer" runat="server" />

</form>

</body>

</html>

<script language="VB" runat="server">

	Sub Page_Load(Sender As Object, e As EventArgs)
		Dim MyNews As NewsDB=New NewsDB()
		Dim MyDV As DataView
		Try
			MyDV=MyNews.GetNewsContent(CInt(Request("id")))
			If MyDV.Table.Rows.Count<1 Then
				errormsg.Visible=true
				dtitle.Text="警告!"
			Else
				errormsg.Visible=false
				dtitle.text=MyDV.Table.Rows(0)("NewsTitle")
			End If
			content.DataSource=MyDV
			content.DataBind()
			content.Visible=true
		Catch
			content.Visible=false
			errormsg.Visible=true
		End Try
	End Sub

</script>
<style>
td {
	font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
	font-size : 10pt;
}
.whiteB {
	color: white;
	font-weight : bold;
}
input {
	font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
	font-size : 10pt;
}
td.bar {
	color: green; font-weight: bold;
}
a.whiteLink:link {
	font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
	font-weight : bold;
	color : white;
	text-decoration : none;
}
a.whiteLink:visited {
	font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
	font-weight : bold;
	color : white;
	text-decoration : none;
}
a.whiteLink:hover {
	font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
	font-weight : bold;
	color : white;
	text-decoration : none;
}
a.barLink:link {
	font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
	color : #CCFF99;
	text-decoration : none;
}
a.barLink:visited {
	font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
	color : #CCFF99;
	text-decoration : none;
}
a.barLink:hover {
	font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
	color : #CCFF99;
	text-decoration : underline;
}
a.author:link {
	font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
	color : black;
	text-decoration : none;
}
a.author:visited {
	font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
	color : black;
	text-decoration : none;
}
a.author:hover {
	font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
	color : black;
	text-decoration : underline;
}
</style>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -