asp.net webform ViewState Grab bag code (1/2)

Source: Internet
Author: User
Tags http post

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:

View Source
Print?
01 protectedvoid dropdownlist1_selectedindexchanged(objectsender, eventargs e)
02         {
03  
04         }
05  
06  protectedvoid button1_click(objectsender, eventargs e)
07         {
08             if(dropdownlist1.selectedvalue == "two")
09             {
10                 lblinfor.text = "two";
11             }
12             else
13             {
14                 lblinfor.text = "one";
15             }
16         }

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.

Home 1 2 last page
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.