Request.QueryString为空时出错 [英] Error when Request.QueryString is empty

查看:70
本文介绍了Request.QueryString为空时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时用户会错误地重定向到?Process = ViewImages& PAGEID =.发生这种情况时,他们会收到以下错误.

Sometimes users mistakenly redirected to ?Process=ViewImages&PAGEID=. When this happens, they get the following error.

Microsoft VBScript运行时错误'800a000d'

Microsoft VBScript runtime error '800a000d'

类型不匹配:'[string:"]'

Type mismatch: '[string: ""]'

/FLPM/cp/images.cs.asp,第91行

/FLPM/cp/images.cs.asp, line 91

我尝试使用以下代码修复它,但仍然出现相同的错误.

I tried to fix it with the following codes but still get the same error.

PAGEID = Request.QueryString("PAGEID")

If PAGEID = "" or PAGEID = NULL or PAGEID = 0 Then
    PAGEID = 1
End If

推荐答案

if IsNumeric(pageId) and pageId <> "" then
  pageId = Cint(pageId)
else
  pageId = 1
end if

这将在接受它之前检查pageId是否具有值并且是数字值.

this will check if the pageId has a value and is a numeric value, before accepting it..

这篇关于Request.QueryString为空时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆