ASP后台新闻可发不可改?怎么回事?
<%Setrs_news=Server.CreateObject("Adodb.Recordset")Sql="Select*From[News]WhereID="&Ci...
<%
Set rs_news=Server.CreateObject("Adodb.Recordset")
Sql="Select * From [News] Where ID="&Cint(Request("id"))
rs_news.Open Sql,Conn,1,1
%>
<table width="100%" border="0" cellpadding="2" cellspacing="1">
<tr>
<td height="22" align="right">新闻名称:</td>
<td width="462"> <input name="Title" type="text"
id="Title" value="<%=rs_news("Title")%>" size="50" maxlength="80"> <font color="#FF0000">*</font></td>
</tr>
<tr>
<td height="22" align="right">新闻类别:</td>
<td>
<%
Set b_news=Conn.Execute("Select * From [BigClass_New]")
Response.Write "<select name=BigClass onChange='changelocation(document.myform.BigClass.options[document.myform.BigClass.selectedIndex].value)'>"
If b_news.Eof and b_news.Bof Then
Response.Write "新闻大类!"
Else
Do until b_news.Eof
Response.Write "<option "
If b_news("BigClassName")=rs_news("BigClassName") Then Response.Write "selected "
Response.Write " value=" &Trim(b_news("BigClassName"))& ">" &Trim(b_news("BigClassName"))& "</option>"
b_news.MoveNext
Loop
End if
Response.Write "</select>"
Set s_news=Conn.Execute("Select * From [SmallClass_New] Where BigClassName='"&rs_news("BigClassName")&"'")
Response.Write "<select name=SmallClass>"
If s_news.Eof Then
Response.Write "新闻小类"
Else
Response.Write "<option value='0'>选择新闻小类</option>"
Do until s_news.Eof
Response.Write "<option "
If s_news("SmallClassName")=rs_news("SmallClassName") Then Response.Write "selected"
Response.Write " value=" &Trim(s_news("SmallClassName"))& ">" &Trim(s_news("SmallClassName"))& "</option>"
s_news.MoveNext
Loop
End if
Response.Write "</select>"
%>
</td>
</tr>
<tr>
<td height="22" align="right" valign="middle">新闻说明:</td>
<td> </td>
</tr>
<tr>
<td colspan="2" align="right" valign="middle"> <div align="left">
<%
rs_news.Close
set rs_news=Nothing
call CloseConn()
%>
<div align="center">
<p>
<input name="add" type="submit" id="add" value="修改">
</p>
</div>
</form> 展开
Set rs_news=Server.CreateObject("Adodb.Recordset")
Sql="Select * From [News] Where ID="&Cint(Request("id"))
rs_news.Open Sql,Conn,1,1
%>
<table width="100%" border="0" cellpadding="2" cellspacing="1">
<tr>
<td height="22" align="right">新闻名称:</td>
<td width="462"> <input name="Title" type="text"
id="Title" value="<%=rs_news("Title")%>" size="50" maxlength="80"> <font color="#FF0000">*</font></td>
</tr>
<tr>
<td height="22" align="right">新闻类别:</td>
<td>
<%
Set b_news=Conn.Execute("Select * From [BigClass_New]")
Response.Write "<select name=BigClass onChange='changelocation(document.myform.BigClass.options[document.myform.BigClass.selectedIndex].value)'>"
If b_news.Eof and b_news.Bof Then
Response.Write "新闻大类!"
Else
Do until b_news.Eof
Response.Write "<option "
If b_news("BigClassName")=rs_news("BigClassName") Then Response.Write "selected "
Response.Write " value=" &Trim(b_news("BigClassName"))& ">" &Trim(b_news("BigClassName"))& "</option>"
b_news.MoveNext
Loop
End if
Response.Write "</select>"
Set s_news=Conn.Execute("Select * From [SmallClass_New] Where BigClassName='"&rs_news("BigClassName")&"'")
Response.Write "<select name=SmallClass>"
If s_news.Eof Then
Response.Write "新闻小类"
Else
Response.Write "<option value='0'>选择新闻小类</option>"
Do until s_news.Eof
Response.Write "<option "
If s_news("SmallClassName")=rs_news("SmallClassName") Then Response.Write "selected"
Response.Write " value=" &Trim(s_news("SmallClassName"))& ">" &Trim(s_news("SmallClassName"))& "</option>"
s_news.MoveNext
Loop
End if
Response.Write "</select>"
%>
</td>
</tr>
<tr>
<td height="22" align="right" valign="middle">新闻说明:</td>
<td> </td>
</tr>
<tr>
<td colspan="2" align="right" valign="middle"> <div align="left">
<%
rs_news.Close
set rs_news=Nothing
call CloseConn()
%>
<div align="center">
<p>
<input name="add" type="submit" id="add" value="修改">
</p>
</div>
</form> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询