As indicated by another post, this wont work in page preview, but should be OK once site is published.