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

前端 未结 5 1905
攒了一身酷
攒了一身酷 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:46

    I always explicitly specify the collection. If for some reason you want to allow overrides, code the "get" for each one and write some clear code that shows your hierarchy for choosing one over the other. IMO, I dislike getting a value from multiple sources without a clear business reason for so doing.

提交回复
热议问题