Skip to content
Related Articles

Related Articles

Improve Article
ASP Dictionary.Keys Method
  • Last Updated : 31 Mar, 2021

The ASP Dictionary.Keys Method is used for returning an array of all the keys in a Dictionary Object. 

Syntax:

DictionaryObject.Keys

Example Code: Below code demonstrates the ASP Keys Method. 

ASP




<%
dim d,a,i
set d=Server.CreateObject("Scripting.Dictionary")
d.Add "m","mango"
d.Add "e","Elephant"
d.Add "n","Nagaland"
  
Response.Write("
<p>Key values:</p>
")
a=d.Keys
for i=0 to d.Count-1
  Response.Write(a(i))
  Response.Write("<br>")
next
  
set d=nothing
%>

Output:

Key values:

m
e
n
My Personal Notes arrow_drop_up
Recommended Articles
Page :