ASP.net today's question is about submitting a form in a asp.net environment. I wrote a button-triggered event like ASP and then used Formname.submit to submit. Results hint:
Bc30451:name ' Form1 ' is not declared.
But I was in the back of the form is clearly defined Ah, the source code is as follows:
<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>
<body>
<center>
<form name= "Form1" method= "Post" action= "check.aspx" runat= "Server" >
<table width= "border=" "1" >
<tr>
<th width= "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
<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>
It seems that there are really too many differences between the ASP and ASP.net, so that one time really dizzy death. Still have to consult the expert. After all,--asp. NET is my future direction, must be very skilled grasp!