The pagecontext object provides methods to access other hidden objects.
In the pagecontext object, you can use the following two methods to save and obtain attributes:
Setattribute (string name, object value)
Getattribute (string name)
Attributes saved in the pagecontext object can only be obtained on the current page. That is, the pagecontext object has a page range.
Papgecontext object. You can also set and obtain attributes saved in other range objects. Use the following two methods:
Setattribute (string name, object value, object value, int scope)
Getattribute (string name, int scope)
Scope can be pagecontext. page_scope/request_scope/session_scope...
In pagecontext, you can use the following two methods to delete attributes in a range:
Removeattribute (string name, int scope)
Removeattribute (string name) // delete all attributes with names in the specified range
Page also provides the following methods to search for attributes:
Object findattribute (string name) // searches for the attribute of the specified name in the order of page, request, session, and application. If the attribute is found, the value of the attribute is returned. If not, null is returned.
From the method provided by the pagecontext object, we can see that the pagecontext object actually provides a unified entrance to access other hidden objects. In most cases, you can directly use the pagecontext object to complete the desired function.