What is the form collection in asp.net/html?

A simple question, but I need to clarify for myself. In terms of collections that can be accessed in the request object, there are:

Cookies: (whats in a text file in the browser) Querystring: (whats passed in the url like [key=value&key=value etc]) Server Variables: ? Form Variables: ? 

Those who have? next to the ones that I really don’t understand where in the http package / html they are located. I made a capture using wirehark:

 POST /Security/HelixSessionAuth.aspx HTTP/1.0 Content-Type: application/x-www-form-urlencoded Content-Length: 391 ClientIP=192.168.20.31 Url=%2Fflash%2F56553550%5Fhi%2Emp4 Log=SESSIONSTART%20%5B13%2FDec%2F2010%3A16%3A31%3A23%20%2B0000%5D%20%20flash%2F56553550%5Fhi%2Emp4%200%20192%2E168%2E20%2E31%203%20%5B13%2FDec%2F2010%3A16%3A31%3A23%20%2B0000%5D%200%200%200%20%5B0%20No%20Error%5D%20%5B0%20No%20Error%5D%20%5Brtmp%3A%2F%2Fhelix%2Epete%2Evideolibraryserver%2Ecom%2Fflash%2F56553550%5Fhi%2Emp4%5D%0A HTTP/1.1 404 Not Found Content-Type: text/html; charset=us-ascii Server: Microsoft-HTTPAPI/2.0 Date: Mon, 13 Dec 2010 16:31:23 GMT Connection: close Content-Length: 315 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd"> <HTML><HEAD><TITLE>Not Found</TITLE> <META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD> <BODY><h2>Not Found</h2> <hr><p>HTTP Error 404. The requested resource is not found.</p> </BODY></HTML> 

Where would they be in the feed above?

+4
source share
3 answers

A collection of forms is a list of controls on the page that are passed to the action page through the POST method. Querystring is a GET, POST adds elements to the Form collection. If you know the name of the control in POST, you can access its value on the action page using:

 Request.Form("myControl") 

In .Net web forms, this is a bit more complicated because .Net implements a specialized ClientID to store the identifier of the actual control in code.

A server collection is a collection of common server variables that identify information about a client, server, connection, browser, etc. A complete list can be found here:

https://msdn.microsoft.com/en-us/library/ms524602(v=vs.90).aspx

+2
source

Wireshark for this bit of sledgehammer-to-crack-nut, I would suggest starting with the MSDN documentation for HttpRequest . This should help you understand what collections of forms and servers are and what they represent, then you will know what you are looking for in the actual data package.

+2
source

First about your instrument. WireShark is a low-level packet analysis tool that you don't need to learn HTTP concepts. Use Fiddler instead.

ServerVariables:

This is an old object from asp classic. There are now many aliases for their objects. For example, Request.UserHostAddress is an alias for Request.ServerVariables("remote_addr") . In addition, Headers , Cookies , Session , ... objects are accessible from this object. This object has more backward compatibility.

Variable forms:

All controls in ASP.NET are tracked using an ASP.NET identifier, and their state is stored in a hidden ViewState field. view, this is the method used by the ASP.NET webpage to save changes to the state of the web form through PostBacks . Thus, on each PostBack (form message, that is, click the button), ASP.NET on the server side will PostBack form object and its children (controls inside the form) from the post data. This is what we call a collection of forms.

+1
source

Source: https://habr.com/ru/post/1332090/


All Articles