.Net 获取前端传递的数据

1. DotNet MVC:

form是用来获得表单提交的数据;
querystring是用来获得标识在URL后面的所有返回的变量及其值。
比如常见的URL网页地址都有xxx.asp?pn=123456
?号后面的就是querystring,URL的querystring参数就是变量pn等于123456,用request("变量")取得数值
Request.QueryString["pn"]


Request.Form["pn"]

2.DotNet Core MVC:

Request.Query["pn"].ToString()
原文地址:https://www.cnblogs.com/kongxiaoshuang/p/6495474.html