首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 网站建设 > ASP.NET > 修改资料代码(测试成功)
【标  题】:修改资料代码(测试成功)
【关键字】:
【来  源】:http://blog.csdn.net/zhyhu2008/archive/2006/07/29/998664.aspx

修改资料代码(测试成功)

 

数据库的字段看上面的...

tch_tch.asp文件

<!--#include file="../conn/conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>教师资料修改</title>
<LINK href="css.css" rel=stylesheet>
<script language="JavaScript" type="text/JavaScript">
<!--
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>
</head>

<body>
<%
  tch_no=session("tch_no")
  Sql="select * from tch"
  Set rs=Server.CreateObject("ADODB.RecordSet")
  Rs.Open sql,conn,1,3
  If not rs.eof then
%>
<table width="428" border="0" align="center">
  <tr>
    <td width="422" colspan="2" align="left">&nbsp;</td>
  </tr>
  <%
 End if
%>
</table>

<table width="500" height="214" border="0" align="center" cellpadding="5" cellspacing="1">
  <tr>
    <td height="214" colspan="3" align="center"><form name="form1" method="post" action="tch_tch_ok.asp">
      <table width="480" border="0" align="center" cellpadding="5" cellspacing="1">
        <tr>
          <td align="center">教师编号:</td>
          <td width="361"><label>
            <input name="tch_no" type="text" value="<%= Session("tch_no")%>" maxlength="8" readonly="true">
          </label></td>
        </tr>
        <tr>
          <td align="center">教师姓名:</td>
          <td><input name="tch_name" type="text" value="<%= Session("tch_name")%>" maxlength="9" readonly="true"></td>
        </tr>
        <tr>
          <td align="center">教师性别:</td>
          <td><input name="tch_sex" type="text" value="<%= Session("tch_sex")%>" maxlength="9" readonly="true"></td>
        </tr>
  <tr>
          <td align="center">教师职称:</td>
          <td><input type="text" name="tch_zc">
              <font color="#FF0000">*</font></td>
        </tr>
        <tr>
          <td align="center">教&nbsp;研&nbsp;室:</td>
          <td><input type="text" name="tch_jys">
              <font color="#FF0000">*</font></td>
        </tr>
        <tr>
          <td align="center">研究方向:</td>
          <td><input type="text" name="tch_yjfx">
              <font color="#FF0000">*</font></td>
        </tr>
        <tr>
          <td align="center">学历(位):</td>
          <td><input type="text" name="tch_lev">
              <font color="#FF0000"> *</font></td>
        </tr>
        <tr>
          <td align="center">学院职务:</td>
          <td><input type="text" name="tch_zw">
              <font color="#FF0000">*</font></td>
        </tr>
      
      <tr>
          <td align="center">输入密码:</td>
          <td><input type="text" name="tch_pwd">
              <font color="#FF0000">*(请输入您的密码以确认)</font></td>
        </tr>
     
        <tr>
          <td align="right">&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td colspan="2" align="center"><input type="submit" name="Submit" value="提交"> &nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" name="Submit2" value="重置"></td>
          </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>如需帮助请与管理员联系QQ:64591732</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
      </table>
      </form></td>
  </tr>
</table>
<p>&nbsp;</p>
</body>
</html>

tch_tch_ok.asp文件

<!--#include file="../conn/conn.asp"-->

<% 

  tch_no=request.form("tch_no")
  tch_sex=request.form("tch_sex")
  tch_zc=request.form("tch_zc")
  tch_jys=request.form("tch_jys")
  tch_yjfx=request.form("tch_yjfx")
  tch_zw=request.form("tch_zw")
  tch_lev=request.form("tch_lev")

 
      Sql="select * from tch where tch_no='"&tch_no&"' "
    set rs=server.createobject("adodb.recordset")
    rs.open sql,conn,1,3
   

      rs("tch_zc")=tch_zc
      rs("tch_jys")=tch_jys 
      rs("tch_yjfx")=tch_yjfx
      rs("tch_zw")=tch_zw
      rs("tch_lev")=tch_lve
   rs.update
   rs.close
   set rs=nothing

    response.write   "ok"

%>

在Web control Lib中使用ASCX文件:【上一篇】
AS作品等级划定[续]:如何用更少的时间赚更多的钱----闪客小东:【下一篇】
【相关文章】
没有相关文章
【随机文章】
  • 再次学习sed
  • 完成端口与高性能服务器程序开发(zz)
  • Longhorn能运行多操作系统
  • 恢复笔记本电脑电池容量的技巧
  • 神州6号发射成功了--庆祝一下
  • 中国当代教育弊病的根源在于其功利性!
  • C#中的cookie编程
  • Master server改主机名(或迁移)的方法
  • [Portal参考手册]目录
  • FTP架站方法
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 软讯网络 All Rigths Reserved.