Skip to main content

%CSP.Request Example: Query String

A query string is a set of name-value pairs appended to a URL with a “?” symbol. For example, here is a url with the name value pair “OBJID=1” in its query string:


http://127.0.0.1:8972/csp/user/Contact.csp?OBJID=1

The CSP Server places all of the name-value pairs from a query string into the Data property of the %request object sent to the CSP page. The following code retrieves the value of OBJID from the Data property of %request:


$Get(%request.Data("OBJID",1))

Here is a <csp:object> tag that binds the Contact object with the object id passed in on the URL's query string:


<csp:object name="objForm" classname="CSPTutorial.Contact" 
OBJID=#($Get(%request.Data("OBJID",1)))#/>
FeedbackOpens in a new tab