欢迎光临
我们一直在努力

游走于ASP与ASP.NET的郁闷-ASP教程,ASP应用

建站超值云服务器,限时71元/月

今天的问题是,关于在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>

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

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 游走于ASP与ASP.NET的郁闷-ASP教程,ASP应用
分享到: 更多 (0)

相关推荐

  • 暂无文章