VOOZH about

URL: https://www.geeksforgeeks.org/websites-apps/asp-add-method/

⇱ ASP Add Method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

ASP Add Method

Last Updated : 22 Mar, 2021

The ASP Dictionary.Add Method is used to add a new key-value pair to the Dictionary Object.

Syntax:

DictionaryObject.Add(key, item)

Parameters: This method has two parameters as mentioned above and described below:

  • key: It specifies the name of the key to be inserted. It is a required parameter.
  • item: It specifies the value that has to be associated with the key in the key-value pair.

Example: The below code demonstrates the ASP Dictionary.Add Method.

Output:

Value of key 'br' is: Brown
Value of key 'p' is: Pink
Comment
Article Tags: