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: