The action and method (the methods of Post and get) in the form are used

Source: Internet
Author: User

First, the form inside the action and method of post use

<%@ Page language="C #"autoeventwireup="true"codefile="Formsubmitpost.aspx.cs"inherits="Formsubmitpost"%><! DOCTYPE html>"http://www.w3.org/1999/xhtml">"Server"><meta http-equiv="Content-type"Content="text/html; Charset=utf-8"/> <title></title>"Form1"runat="Server" action=" formsubmitget.aspx "Method="Post"> <div> <input id="b"Name="b"Value="123"/> <input id="W"Type="Submit"/> </div> </form></body>

When you click the button to submit the browser address is http://localhost:1621/formsubmitpost.aspx, the page will refresh but the address is not changed

The Get use method of action and method in form

<%@ Page language="C #"autoeventwireup="true"codefile="Formsubmitget.aspx.cs"inherits="Formsubmitget"%><! DOCTYPE html>"http://www.w3.org/1999/xhtml">"Server"><meta http-equiv="Content-type"Content="text/html; Charset=utf-8"/> <title></title>"Form1"runat="Server"action= "Formsubmitget.aspx" method="Get"> <div> <input id="a"Name="a"Value="123"/> <input id="W"Type="Submit"/> </div> </form></body>

But when you click on the button to submit, the browser address is http://localhost:1621/formsubmitget.aspx?__VIEWSTATE=% 2fwepdwukltezndm3nzkxowrkebfil8xbs6u8bvkloo5sf6fsak0otj6zuc4n2an9oe4%3d&a=123&__viewstategenerator= 4b2c1984

And this address contains the values you passed.

In summary, the post will not show the value of the pass, then it is more secure

The action and method (the methods of Post and get) in the form are used

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.