asp classic - IsNumeric() not working with Request.QueryString -
i'm having problems trying isnumeric work request.querystring.
the server windows 2008 r2 / iis7.5
my code not simpler:
<%@ language=vbscript %> <% response.write "isnumeric: " & isnumeric(request.querystring("")) %> my url: http://localhost.com/default2.asp?44hjh
the output: isnumeric: true
if change code this, desired outcome:
<%@ language=vbscript %> <% response.write "isnumeric: " & isnumeric(request.querystring("test")) %> my url: http://localhost.com/default2.asp?test=44hjh
the output: isnumeric: false
why isnumeric not work when don't specify specific querystring element? , more importantly, how can fix it?
request.querystring("") doesn't exist , returns null -- there isn't parameter blank. isnumeric of null value return true.
instead of using request.querystring(""), can either supply parameter did in 2nd example, or use request.querystring assuming no other parameters being passed page:
<% response.write "isnumeric: " & isnumeric(request.querystring) %>
Comments
Post a Comment