Check if unassigned variable exists in Request.QueryString

后端 未结 5 636
伪装坚强ぢ
伪装坚强ぢ 2021-02-07 05:59

Within the context of an ASP.NET page, I can use Request.QueryString to get a collection of the key/value pairs in the query string portion of the URI.

For example, if I

5条回答
  •  别那么骄傲
    2021-02-07 06:18

    Request.QueryString.ToString().Contains("test")
    

    This works in the special case where you're looking for a single querystring parameter, e.g. MyFile.aspx?test

    For more complex, general, cases then other solutions would be better.

提交回复
热议问题