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.