ASP

本类阅读TOP10

·asp常用数据库连接方法和技巧
·无组件生成BMP验证码
·一些常用的辅助代码 (网络收藏)
·JavaScript实现的数据表格:冻结列、调整列宽和客户端排序
·VisualStudio.NET_2003及其 MSDN 下载地址
·ASP模拟MVC模式编程
·图片以二进制流输出到网页
·MD5加密算法 ASP版
·ASP.NET编程中的十大技巧
·改进 ASP 的字符串处理性能

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
游走于ASP与ASP.NET的郁闷

作者:未知 来源:月光软件站 加入时间:2005-2-28 月光软件站

今天的问题是,关于在ASP.NET的环境下提交表单。我和ASP一样编写了一个按钮触发的事件,然后使用formname.submit来进行submit。结果提示:

BC30451: Name 'form1' is not declared.

但我在后面的表单里明明是定义了啊,源代码如下:

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<title>index</title>

<script language="vb" runat="server">

       sub bt_submit(sender AS Object,e As EventArgs)

              form1.submit

       end sub

       sub bt_cancel(sender AS Object,e As EventArgs)

              txt.text=""

              txtpwd.text=""

              txtpwd2.text=""

              txtemail.text=""

       end sub

</script>

</head>

<body>

<center>

<form name="form1" method="post" action="check.aspx" runat="server">

  <table width="533" border="1">

    <tr>

      <th width="220" scope="row"><div align="right">ID:</div></th>

      <td width="297"><asp:TextBox ID="txtid" runat="server" />

        </td>

    </tr>

    <tr>

      <th scope="row"><div align="right">Password:</div></th>

      <td><asp:TextBox ID="txtpwd1" TextMode="Password" runat="server" Text='12345678' />

        </td>

    </tr>

    <tr>

      <th scope="row"><div align="right">input password again:</div></th>

      <td><asp:TextBox ID="txtpwd2" TextMode="Password" runat="server" Text='12345678' />

        </td>

    </tr>

    <tr>

      <th scope="row"><div align="right">Sex:</div></th>

      <td><asp:RadioButtonList ID="RadioButtonList" runat="server">

        <asp:ListItem value="1">Men</asp:ListItem>

        <asp:ListItem value="2">Female</asp:ListItem>

              </asp:RadioButtonList>

      </td>

    </tr>

    <tr>

      <th scope="row"><div align="right">e-Mail:</div></th>

      <td><asp:TextBox ID="txtemail" runat="server" />

        </td>

    </tr>

    <tr>

      <th colspan="2" scope="row"><div align="center">

        <asp:Button ID="btsubmit" runat="server"

                     Text="Submit"

                     BorderStyle="ridge"

                    BackColor="lightblue"

                     onmouseover="this.style.backgroundColor='ff3366'"

                     onmouseout="this.style.backgroundColor='lightblue'" />       

        <asp:Button ID="btcancel" runat="server"

                     Text="Cancel"

                     BorderStyle="ridge"

                    BackColor="lightblue"

                     onmouseover="this.style.backgroundColor='ff3366'"

                     onmouseout="this.style.backgroundColor='lightblue'" />       

      </div></th>

      </tr>

  </table>

</form>

</center>

</body>

</html>

看来ASPASP.NET之间真的是有太多的不同了,这样一来一回真是晕死。还得继续请教高人。毕竟——ASP.NET才是偶未来的方向,一定要很熟练的掌握!




相关文章

相关软件