📄 newsview.aspx
字号:
<!--该页的作用是当用户在main.aspx中点击某新闻的标题字段时,在打开的新窗口中显示该
新闻的详细内容。
-->
<%@ Page Language="VB" ContentType="text/html" debug="true" %>
<%@ Import Namespace="system.data" %>
<%@ Import Namespace="system.data.oledb" %>
<html>
<head>
<title>最新咨询</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="CSS.CSS" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#CCCCCC">
<table width="549" height="400" border="1" cellpadding="0" cellspacing="0" bordercolorlight="#008080" bordercolordark="#FFFFFF" bgcolor="#FFFFFF">
<tr>
<td height="333">
<asp:repeater runat="server" ID="myrpt">
<headertemplate>
<table width="500" height="391" border="0" align="center" cellpadding="0" cellspacing="1">
</headertemplate>
<itemtemplate>
<tr>
<td width="390" height="18"><%# format(container.dataitem("odate"),"yyyy-MM-dd") %></td>
<td width="49" height="18"> 打印
<input type=image value="打印" src="pic/printpage.gif"onclick="document.execCommand('print','true','true')"> </td>
<td width="57" height="18">保存
<input type=image value="保存" src="pic/saveas.gif"onclick="document.execCommand('saveas','true','.htm')"></td>
</tr>
<tr>
<td height="15" colspan="3"><div align="center"><font color="#000000"><strong><%# container.dataitem("otitle") %></strong></font></div></td>
</tr>
<tr>
<td height="1" colspan="3"> <div align="center">
<hr size="1" color="#008080" noshade>
</div></td>
</tr>
<tr valign="top" bgcolor="#FFFFFF">
<td height="213" colspan="3">
<%# container.dataitem("ocontent") %></td>
</tr>
<tr>
<td height="16" colspan="3">
<hr size="1" color="#008080">
</td>
</tr>
<tr>
<td height="29" colspan="3"><div align="center">办公自动化OA(ASP.NET版)</div></td>
</tr>
</itemtemplate>
<footertemplate>
</table>
</footertemplate>
</asp:repeater>
</td>
</tr>
</table>
</body>
</html>
<script language="VB" runat="server">
sub page_load(s as object,e as eventargs)
if not ispostback then bindlist()
end sub
sub bindlist()
'找出与id号相同的新闻数据,id号参数由main.aspx在URL中传递。
dim conn as new oledbconnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath("office.mdb"))
conn.open()
dim objada as new oledbdataadapter("select odate,otitle,ocontent from news where id=" & request.QueryString("id"),conn)
dim ds as new dataset()
objada.fill(ds,"news")
myrpt.datasource=ds
myrpt.databind()
conn.close()
end sub
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -