Form (POST) and query string (GET) values

XsltDb provides 3 methods that allow access to controls values and query string parameters:
  • mdo:request ( parameter-name, [default-value] ) - returns GET or POST value.
  • mdo:form ( parameter-name, [default-value] ) - returns POST value
  • mdo:query-string ( parameter-name, [default-value] ) - returns GET value

If parameter is not present in the collection or set to empty value default-value is returned. So mdo:request(name, value) is equal to mdo:coalesce(mdo:request(name),value).

Example.

Assume we have an http://yoursite.com/Home.aspx page.

1. Put XstlDb module on that page and create the following configuration:

ID = <xsl:value-of select="mdo:query-string('id', 'not set')"/>
<!-- you can also use short form:
ID = {{mdo:query-string('id', 'not set')}} -->
2. Try different URLs:

http://yoursite.com/Home.aspx
ID = not set

http://yoursite.com/Home.aspx?id=123
ID = 123

Last edited Aug 9, 2010 at 5:09 AM by findy, version 6

Comments

No comments yet.