Request[“key”] vs Request.Params[“key”] vs Request.QueryString[“key”]

前端 未结 5 1902
攒了一身酷
攒了一身酷 2020-12-07 14:04

Request[\"key\"] vs Request.Params[\"key\"] vs Request.QueryString[\"key\"]

Which method do you seasoned programmers use? and

5条回答
  •  悲&欢浪女
    2020-12-07 14:59

    As a kindly notice, If you set requestValidationMode="4.5" under web.config, both Request.QueryString[“key”] and Request[“key”] will use "lazy loading" behavior as design.

    However, somehow Request.Params[“key”] will still trigger validation as the behavior of 4.0 .

    This odd behavior really confuses me for a long time.

提交回复
热议问题