How do I check if a query string has a parameter in VB.NET? I'm having a hard time adapting C# code to VB.
I'm particularly interested in determining if a value-less/key-less parameter exists.
Pseudo-Code:
If Request.QueryString.Contains("test") Then
' ...
End If
Examples:
http://example.com/mypage.aspx?test
http://example.com/mypage.aspx?test=1
http://example.com/mypage.aspx?someparam=1&test&anotherparam=2
To clarify, I don't care whether or not test has a value. I just want to know if it is in the query string or not.
if Request.QueryString("test").Count > 0 then
...
end if
Source: https://www.w3schools.com/asp/coll_querystring.asp
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With