今天的问题是,关于在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> [1] [2] 下一页 [C语言系列]NET 中C#的switch语句的语法 [系统软件]托拽Explore中的文件到VB.net的窗口 [系统软件]Boost库在XP+Visual C++.net中的安装 [常用软件]新配色面板:Paint.Net3.0RC1官方下载 [常用软件]用内建的“Net Meeting”聊天 [VB.NET程序]Henry的VB.NET之旅(三)—共享成员 [VB.NET程序]Henry的VB.NET之旅(二)—构造与析构 [VB.NET程序]Henry的VB.NET之旅(一)—失踪的窗体 [VB.NET程序]在托盘上显示Balloon Tooltip(VB.NET) [VB.NET程序]Henry手记-VB.NET中动态加载Treeview节点(二)
|