新客网WWW.XKER.COM:致力做中国最专业的网络学院!
学院: 操作系统 - 网络应用 - 服务器 - 网络安全 - 工具软件 - 办公软件 - Web开发 - 数据库 - 网页设计 - 图形图像 - 媒体动画 - 硬件学堂 - 存储频道 - QQ专区
您的位置:首页 > 软件开发 > Web开发 > Asp教程 > 正文:游走于ASP与ASP.NET的郁闷

游走于ASP与ASP.NET的郁闷

新客网 XKER.COM 2004-10-22 来源: 收藏本文
今天的问题是,关于在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才是偶未来的方向,一定要很熟练的掌握!


收藏】 【评论】 【推荐】 【投稿】 【打印】 【关闭
发表评论
要记得去论坛讨论,点击注册新会员匿名评论
评论内容:不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
阅读排行
随机推荐
实用信息推荐