Request example of ASP. NET cainiao Road, asp. netrequest

Source: Internet
Author: User

Request example of ASP. NET cainiao Road, asp. netrequest
Background

  • I am an ASP. NET cainiao, now learning ASP. NET. I have recorded the code I personally typed here. There is not much reference value. Please see the friends who gave me a thumbs up to support me. Thank you.
  • Request Value
  • There are two types of Request values.
  • The next example is to obtain the Post value data.
  • Create a web window Request. aspx and enter
  • <Form id = "form1" method = "post" runat = "server"> <div> <asp: TextBox ID = "txtInput" runat = "server"/> <asp: button ID = "btnSubmite" Text = "Submit" runat = "server" OnClick = "btnSubmite_Click"/> </div> </form>
  • Add a btnRegister_Click event to the Redirect. aspx. cs file.
  • Protected void btnSubmite_Click (object sender, EventArgs e) {var input = Request. Form ["txtInput"]; Response. Write ("input value:" + input );}
  • The running effect is to output the registered personal information.
  • Request to obtain browser Information

  • Request also has other functions, such as obtaining browser Information
  • The next example shows some browser information obtained by the Request.
  • Directly use Request. aspx and enter
  • Protected void Page_Load (object sender, EventArgs e) {var http = Request. browser; Response. write ("browser name:" + http. browser + "</br>"); Response. write ("browser type:" + http. type + "</br>"); Response. write ("operating platform:" + http. platform + "</br> ");}

    The display effect is as follows:

    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.