Four parameters are passed in detail, and four parameters are passed in detail.

Source: Internet
Author: User

Four parameters are passed in detail, and four parameters are passed in detail.

This article is summarized in daily work. The following shows the transmission of four parameters.

When to use GET, query, delete,

When to use POST, add, and modify (Special Column: Post for login, because the user name and password cannot be displayed on the URL)

Four get parameter passing Methods


<! -- // Several Parameters -->

<! -- First: directly add a parameter after the URL: -->

Copy codeThe Code is as follows:
Localhost: 21811/Handler1.ashx? Id = 1 & name = "abc"

<! -- Type 2: Use a hyperlink to pass parameters: When you click a hyperlink, the localhost: 21811/Handler1.ashx page is displayed first, and the parameters id and name are passed. -->

<A href = "localhost: 21811/Handler1.ashx? Id = 1 & name = 'abc' "> hyperlink Transfer Parameters </a> </body>
<! -- Method 3: pass through js: the user clicks this button to trigger the onClick event, runs the Go () method, jumps to the localhost: 21811/Handler1.ashx page, and passes the id, and name parameters -->
<Input type = "button" onclick = "Go ()" value = "passing parameters through js methods"/>
<! -- Type 4: pass through form -->

<Form action = "Handler1.ashx" method = "get"> <! -- Note that the connection in the action cannot contain parameters --> <input type = "text" name = "id" value = "3"/> <input type = "text" name = "name" value = "abc"/> <input type = "submit" value = "PASS Parameters"/> </form> </body> 

I believe everyone will like the above Code.

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.