After a user submits a new record, I need to redirect the page to a new page with the new record ID submitted as part of the URL.

so I thought I could put the following into the OnPageRedirect:

e.url = "mynewpage.a5w?TID=" + ltrim(str(e.lastIdentityValue))

(the ID value is a number)

but that is not working. I can't use e.rv.v.r_1.ID because that just comes up as "<auto>" since it's a new row.

How can I get the last identity value in the onpageredirect event?

Note: I have successfully set a session variable using the afterinsertrecord event, then used the session variable instead. But it seems like I should be able to just use the lastidentityvalue in the OnPageRedirect instead of going through all that hassle.