我在嘗試使IsNumeric與Request.QueryString正常工作時遇到問題。IsNumeric()不能與Request.QueryString一起使用
的服務器是Windows 2008 R2/IIS7.5
我的代碼不能再簡單不過:
<%@ LANGUAGE=VBScript %>
<% Response.Write "IsNumeric: " & IsNumeric(Request.QueryString("")) %>
我的URL: http://localhost.com/default2.asp?44hjh
輸出: 則IsNumeric:真
如果我更改我的代碼到這個,那麼我得到期望的結果:
<%@ LANGUAGE=VBScript %>
<% Response.Write "IsNumeric: " & IsNumeric(Request.QueryString("test")) %>
我的URL: http://localhost.com/default2.asp?test=44hjh
輸出: 則IsNumeric:假
爲什麼當我不指定特定的查詢字符串的元素也則IsNumeric不行?更重要的是,我該如何解決它?
奇妙的是,你的例子完美的作品!非常感謝,謝謝:) – Rich 2013-05-02 15:24:33
@Rich - np,很高興我能幫上忙! – sgeddes 2013-05-02 15:36:03