CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
不看会后悔的Windows XP之经验谈 简单快捷DIY实用家庭影院
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  Web 开发 >  ASP

谁能分析这段代码?请高手!

楼主lihangpp()2005-04-02 10:59:58 在 Web 开发 / ASP 提问

我在网上看到这段代码,我想问下如果我现在在文件3点击保存按钮怎么能把文件3中文本框的内容保存到数据库中,请高手详细指教  
  文件名称分别是:  
  main.asp  
  top.asp  
  mid.asp  
  bot.asp  
  深下的就不用说了吧。  
  ------------------------文件1------------------------------  
  <html>  
  <head>  
  <title>主窗体</title>  
  <meta   http-equiv="Content-Type"   content="text/html;   charset=gb2312">  
  </head>  
  <frameset   rows="*,120,80"   frameborder="YES"   border="1"   framespacing="1"   cols="*"   bordercolor="#009999">    
      <frame   name="topFrame"   scrolling="NO"   noresize   src="top.asp"   >  
      <frame   name="midFrame"   src="mid.asp"   noresize   scrolling="NO">  
      <frame   name="botFrame"   scrolling="NO"   noresize   src="bot.asp">  
  </frameset>  
  <noframes><body   bgcolor="#FFFFFF"   text="#000000">  
  </body></noframes>  
  </html>  
  -------------------------文件2-----------------------  
  <html>  
  <head>  
  <title>试题窗体</title>  
  <meta   http-equiv="Content-Type"   content="text/html;   charset=gb2312">  
  <script   language=vbscript>  
  sub   change_value()  
      parent.midFrame.shuaxin()  
  end   sub  
  </script>  
  </head>  
   
  <body   bgcolor="#FFFFFF"   text="#000000">  
  <form   id=form1   name="form1"   method="post"   action="">  
      <table   width="700"   border="0"   cellpadding="0"   cellspacing="3">  
          <tr>    
              <td   width="111"   bgcolor="#66CC99">单选题1:</td>  
              <td   bgcolor="#66CC99">    
                  <input   type="radio"   name="q1"   value="1"   checked   onclick=change_value()>  
                  答案1    
                  <input   type="radio"   name="q1"   value="2"   onclick=change_value()>  
                  答案2    
                  <input   type="radio"   name="q1"   value="3"   onclick=change_value()>  
                  答案3    
                  <input   type="radio"   name="q1"   value="4"   onclick=change_value()>  
                  答案4</td>  
          </tr>  
          <tr>    
              <td   width="111">单选题2:</td>  
              <td>  
                  <input   type="radio"   name="q2"   value="1"   checked   onclick=change_value()>  
                  答案1    
                  <input   type="radio"   name="q2"   value="2"   onclick=change_value()>  
                  答案2    
                  <input   type="radio"   name="q2"   value="3"   onclick=change_value()>  
                  答案3    
                  <input   type="radio"   name="q2"   value="4"   onclick=change_value()>  
                  答案4</td>  
          </tr>  
          <tr>    
              <td   width="111"   bgcolor="#66CC99">多选题3:</td>  
              <td   bgcolor="#66CC99">    
                  <p>    
                      <input   type="checkbox"   name="q3"   value="1"   onclick=change_value()>  
                      答案1    
                      <input   type="checkbox"   name="q3"   value="2"   onclick=change_value()>  
                      答案2    
                      <input   type="checkbox"   name="q3"   value="3"   onclick=change_value()>  
                      答案3    
                      <input   type="checkbox"   name="q3"   value="4"   onclick=change_value()>  
                      答案4</p>  
                  </td>  
          </tr>  
          <tr>    
              <td   width="111">填空题4:</td>  
              <td>    
                  <p>请输入答案  
                      <input   type="text"   name="q4"   value="haha"   onchange=change_value()>  
                  </p>  
                  </td>  
          </tr>  
          <tr>    
              <td   width="111">&nbsp;</td>  
              <td>  
                  <input   type="submit"   name="Sub_ok"   value="交卷">  
              </td>  
          </tr>  
      </table>  
  </form>  
  </body>  
  </html>  
  --------------------文件3-------------------------  
  <html>  
  <head>  
  <title>试题答案保存窗体</title>  
  <meta   http-equiv="Content-Type"   content="text/html;   charset=gb2312">  
  <script   language=vbscript>  
  sub   shuaxin()  
      dim   TStr  
      if   parent.topFrame.document.form1.q1(0).checked   then   document.form1.a1.value=1  
      if   parent.topFrame.document.form1.q1(1).checked   then   document.form1.a1.value=2  
      if   parent.topFrame.document.form1.q1(2).checked   then   document.form1.a1.value=3  
      if   parent.topFrame.document.form1.q1(3).checked   then   document.form1.a1.value=4  
      '获得第一个按钮  
      if   parent.topFrame.document.form1.q2(0).checked   then   document.form1.a2.value=1  
      if   parent.topFrame.document.form1.q2(1).checked   then   document.form1.a2.value=2  
      if   parent.topFrame.document.form1.q2(2).checked   then   document.form1.a2.value=3  
      if   parent.topFrame.document.form1.q2(3).checked   then   document.form1.a2.value=4  
      '获得第二个按钮  
      TStr=""  
      if   parent.topFrame.document.form1.q3(0).checked   then   TStr="1"  
      if   parent.topFrame.document.form1.q3(1).checked   then  
          if   Tstr=""   then  
      TStr="2"  
  else  
      TStr=TStr&",2"  
  end   if  
      end   if  
      if   parent.topFrame.document.form1.q3(2).checked   then  
          if   Tstr=""   then  
      TStr="3"  
  else  
      TStr=TStr&",3"  
  end   if  
      end   if  
      if   parent.topFrame.document.form1.q3(3).checked   then  
          if   Tstr=""   then  
      TStr="4"  
  else  
      TStr=TStr&",4"  
  end   if  
      end   if  
      document.form1.a3.value=TStr  
      document.form1.a4.value=parent.topFrame.document.form1.q4.value  
  end   sub  
  </script>  
  </head>  
  <body   bgcolor="#FFFFFF"   text="#000000"   topmargin="0"   onload=shuaxin()>  
   
  <form   name="form1"   method="post"   action="">  
      <table   width="600"   border="1"   align="center">  
          <tr>    
              <td   colspan="3">   1、    
                  <input   type="text"   name="a1"   readonly>  
                  2、    
                  <input   type="text"   name="a2"   readonly>  
                  <br>  
                  3、  
                  <input   type="text"   name="a3"   readonly>  
                  4、  
                  <input   type="text"   name="a4"   readonly>  
                  (只读属性)</td>  
          </tr>  
          <tr>    
              <td   colspan="3">说明:该页面用隐藏的输入框保存主页面的值。</td>  
          </tr>  
          <tr>    
              <td   width="193">&nbsp;</td>  
              <td   width="69">    
                  <input   type="submit"   name="Sub_ok"   value="保存">  
              </td>  
              <td   width="316">注:该页面的按钮不需要点击</td>  
          </tr>  
      </table>  
  </form>  
  </body>  
  </html>  
  -----------------------文件4----------------------------  
  <html>  
  <head>  
  <title>自动刷新</title>  
  <meta   http-equiv="Content-Type"   content="text/html;   charset=gb2312">  
  <script   language=vbscript>  
  sub   shuaxin()  
      parent.midFrame.document.form1.sub_ok.click  
  end   sub  
  </script>  
  <meta   http-equiv="refresh"   content="60;URL=bon.asp">  
  </head>  
   
  <body   bgcolor="#FFFFFF"   text="#000000">  
  <A   href=#   onclick=shuaxin()>自动刷新页面</a>   (60秒刷新一次)    
  </body>  
  </html>  
  问题点数:0、回复次数:6Top

1 楼boythl(沙漠孤狐【工作,生活,编程】)回复于 2005-04-02 11:04:46 得分 0

这个好像已经问过一次了吧???   -_-Top

2 楼lihangpp()回复于 2005-04-02 11:07:13 得分 0

大哥,拜托说多一遍也不麻烦吧,谢了Top

3 楼wangyingdong(初学asp.net)回复于 2005-04-02 18:39:09 得分 0

太长了Top

4 楼huangleibo()回复于 2005-04-02 19:08:36 得分 0

抱歉,不敢看了。Top

5 楼shenlan198263(深蓝)回复于 2005-04-02 20:48:05 得分 0

我晕。。搞笑呀。怎么都乱套的?Top

6 楼jgj5346176()回复于 2005-04-02 23:08:57 得分 0

这个好像比较简单嘛Top

相关问题

  • 请教:分析一段小代码
  • 请大家来分析一段代码
  • 请高高手替我分析分析这段代码
  • 分析一段代码
  • 请教代码分析
  • 请分析下面代码!
  • 请大家给分析一段代码,高分请教
  • 请帮我分析一下这段代码
  • 请帮忙分析一下,这段C#代码?
  • 请帮忙分析一下,这两段C#代码?

关键词

得分解答快速导航

  • 帖主:lihangpp

相关链接

  • Web开发类图书

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo