When to use GET, check, delete,
When to use post, add, change (Special column: Login with post, because the user name and password can not be displayed on the URL)
4 ways to get the parameters
[HTML]View Plaincopy
- <HTML xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <Meta http-equiv= "content-type" content= "text/html; Charset=utf-8 "/>
- <title></title>
- <script type="Text/javascript">
- function Go () {
- window.location.href="localhost:21811/handler1.ashx?id=1&name= ' abc '"
- }
- </Script>
- </head>
- <body>
- <!--//parameter delivery in several forms-
- <!--First: Add parameters directly after the URL:-->
- Localhost:21811/handler1.ashx? id=1&name="abc"
- <!--second: Pass parameters by hyperlink: When you click on the hyperlink, you will first jump to the Localhost:21811/handler1.ashx page, and then pass the ID and name two parameters past--
- <a href="localhost:21811/handler1.ashx?id=1&name= ' abc '"> Hyperlink pass parameter </a ></body>
- <!--third: Pass the JS method: The user clicks on this button, triggers the onclick event, executes the Go () method, jumps to localhost:21811/ HANDLER1.ASHX page, pass ID, and name two parameters past---
- <input type="button" onclick="Go ()" value="pass the parameter through the JS method" />
- <!--Fourth: Pass through form forms --
- <form action= "handler1.ashx" method="get"><!--Note that the connection inside the action cannot have parameters-- >
- <input type="text" name= "id" value="3" />
- <input type="text" name="name" value="abc" />
- <input type="Submit" value= "Pass parameters"/>
- </form>
- </body>
- </html>
Four forms of parameter passing-----URL, hyperlink, Js,form form