Walk in the asp.net of ASP and the depressed

Source: Internet
Author: User
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>

&LT;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!




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.