Sometimes, an empty string will try to pass through a QueryString of a URL, and we need to catch these before they can get through.
Just as we did in the last two articles URL QueryString«, and URL with Multiple QueryStrings« with checking the values of the QueryString, we also need to make sure a value is given.

Our string
?Type=Something&ID=22
Copy
Search Site
Search Google

or
?Type=Something&ID=
Copy
Search Site
Search Google

[ASP Classic - Check if Value exists in QueryString]
CFFCS | CarrzSynEdit: | ASP/VBScript
<table>
<%if getType = "" or getID = ""then%>
<tr><td colspan="2">No Value given</td></tr>
<%else%>
<tr><td><%=theID%></td><td><%=thePage%></td></tr>
<tr><td><%=getID%></td><td><%=getType%></td></tr>
<%end if%>
</table>

A more complex example.
[ASP Classic - Multie IF ELSE Check if Value exists in QueryString]
CFFCS | CarrzSynEdit: | ASP/VBScript
<table>
<%if getType = "" then%>
<tr><td colspan="2">No Type Value given</td></tr>
<%elseif getID = "" then%>
<tr><td colspan="2">No ID Value given</td></tr>
<%else%>
<tr><td><%=theID%></td><td><%=thePage%></td></tr>
<tr><td><%=getID%></td><td><%=getType%></td></tr>
<%end if%>
</table>

The = Equal with the double quotes; check if the value is empty. Once we know it is empty, we can display a message letting the visitor know they have passed an empty value, "No Value given."