asp.net Ninghua Three: forms and controls

Source: Internet
Author: User

Today I will mainly introduce the following knowledge points:

How HTML forms are submitted

HTM control

Get HTML form Content

Garbled problem

SQL injection

Server-Side Forms

HTML server Control

How HTML forms are submitted

For an ordinary HTML form, it has two important properties: action and method.

The action attribute indicates which program is to be processed by the current form submission, which can be any dynamic Web page or servlet or CGI (Common Gateway Interface), which is usually handled by the ASPX page in asp.net.

The method property indicates how the form forms are submitted. It has two possible values get and post.

Let's use an example to illustrate the difference between get and post. Create two ASPX pages with Dreamweaver8, register.aspx and getuserinfo.aspx respectively. For the moment we don't need to write any code on the getuserinfo.aspx page, the code for the Register.aspx page is as follows:

 <%@ Page language= "C #" contenttype= "text/html" responseencoding= "gb2312"%> 
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
<meta http-equiv= "Content-type" Content= "text/html; charset=gb2312 "/>
<title> User registration </title>
<body>
<form action=" Getuserinfo.aspx "method=" "
<table border=" 1 "width=" 400px "
<tr><td colspan=" 2 "> User Registration </td></tr>
<tr><td> username </td><td><input type= "text" name= "username"/ ></td></tr>
<tr><td> password </td><td><input type= "password" name= "pwd"/ ></td></tr>
<tr><td><input type= "Submit" value= "submitted"/></td><td> <input type= "reset" value= "reset"/></TD></TR>
</table>
</form>
</body>

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.