0

我正在使用当前页面 aspx 作为 url。我在我的页面 url 中传递查询字符串。我的代码用于拆分查询字符串并写入屏幕。我在页面加载方法中编写代码。

my code
------
 Dim strarr() As String
    Dim key
    For Each key In Request.QueryString
        Response.Write(key & ": " & Request.QueryString(key) & "<BR>")

    Next

output
------
http://localhost:54592/vicidial_project/Default.aspx?a=1&b=2(in run time am passing query string to that url)

a:1
b:2

the query string values are displayed in the screen like above.

my question
-----------
i want to store that query string value into an array . am using the code like this

code
-----
 Dim strarr() As String
    Dim key
    For Each key In Request.QueryString
        Response.Write(key & ": " & Request.QueryString(key) & "<BR>")
       strarr = key & ": " & Request.QueryString(key)

    Next

error
-----
 am getting error in this line
 strarr = key & ": " & Request.QueryString(key)
4

1 回答 1

0

为什么不将键声明为字符串?你可以这样做:

For Each key as String in Request.QueryString
   ...
Next
于 2012-08-09T13:16:21.647 回答