在线等待,谁能帮我这段asp.net代码分离出来。生成cs文件。立即给分
<%@Page Language="c#"%>
<%@ Register TagPrefix="UserControl" TagName="top" src="/top.ascx"%>
<%@ Register TagPrefix="UserControl" TagName="bottom" src="/bottom.ascx"%>
<%@Import Namespace="System.Data"%>
<%@Import Namespace="System.Data.SqlClient"%>
<script language="C#" runat="server">
void Page_Load()
{
int id=Convert.ToInt32(Request.QueryString["id"]);
string html="",memo="";
SqlConnection Conn=new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["ConnectionString"]);
Conn.Open();
SqlCommand Cmd = new SqlCommand( "select subject,memo from changnews where id="+id+" order by id desc", Conn );
SqlDataReader dr = Cmd.ExecuteReader();
//判断是否显示记录
if ( dr.Read() )
{
memo=dr["memo"].ToString();
memo=memo.Replace(" "," ");
html+="<table width=560 border=0 align=center cellpadding=0 cellspacing=0>";
html+="<tr>";
html+="<td height=22 align=center class=bt>";
html+="<strong><font color=#CC0000>"+dr["subject"].ToString()+"</font></strong>";
html+="</td>";
html+="</tr>";
html+="<tr><td height=10></td></tr>";
html+="<tr><td height=22 class='li'>"+memo+"</td></tr>";
html+="<tr><td height=10></td></tr>";
html+="</table>";
}
divShow.Text=html;
dr.Close();
Conn.Close();
}
</script>
<html>
<head>
<title>欢迎你来到长三角网</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><UserControl:top id="top" runat="server"/></td>
</tr>
</table>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="top">
<table width="560" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="22"><asp:label ID="divShow" runat="server"/></td>
</tr>
</table>
</td>
<td width="170" valign="top" bgcolor="#004684"><!--#include file="right.asp"--></td>
</tr>
</table>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><UserControl:bottom id="bottom" runat="server"/></td>
</tr>
</table>
</body>
</html>