ASP tutorial. NET WebForm development of the site grab package function. This feature requires the use of the account in the network through our own program to get the data within the site. During this period, HttpWebRequest was used for grasping the bag. The specific process of grasping the bag is not focused on the discussion. To share with you a little bit more about the role of viewstate in the ASP.net tutorial WebForm during the grab package. If there are deficiencies, I hope you can point out.
To simulate HTTP Post/get we built two projects with VS, screenshots are as follows:
Note: The first project is a simple asp.net Web Form program, and the second is a WinForm program that simulates Web form.
WebApplication1 execution is as follows:
Two server-side controls DropDownList and button server-side corresponding events are as follows:
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 functional code is very simple, button1 the text value of the DropDownList when clicked:
WebForm Introduction, the rest is to use WinForm HTTP post/get to simulate the Web Form program, the program runs the interface as follows:
Here the Onepost and Twopost respectively simulate the Post button click function in WebForm.