Asp tutorial. net webform developed by the site packet capture function. This function requires you to use an account in the outlet to obtain data on the website through our own program. Httpwebrequest is used for packet capture. The specific packet capture process will not be discussed in detail. The purpose is to share with you the role of viewstate in asp.net webform in the packet capture process. If there are any deficiencies, we hope you can point them out.
To simulate http post/get, we use vs to create two projects, as shown below:
Note: The first project is a simple asp.net web form program, and the second is to simulate the winform program of web form.
Run webapplication1 as follows:
The two server-side controls dropdownlist and button server-side events are as follows:
View source Print?
01 |
protected void dropdownlist1_selectedindexchanged( object sender, eventargs e) |
06 |
protected void button1_click( object sender, eventargs e) |
08 |
if (dropdownlist1.selectedvalue == "two" ) |
10 |
lblinfor.text = "two" ; |
14 |
lblinfor.text = "one" ; |
The function code is very simple. The text value of dropdownlist is displayed after button1 is clicked:
After webform is introduced, winform is used to simulate the web form program through http post/get. The program running interface is as follows:
Here, onepost and twopost simulate the post button click function in webform respectively. 1 2