This topic is locked

Autopopulate edit pages

1/5/2007 7:48:27 AM
ASPRunnerPro General questions
author

I have an edit page with a "last updated on" field. I would like to use the Now() function to insert the current date but this does not appear to work.

It works fine on Add pages but not edit pages.
Similarly I have a "last updated by" field and I would like to auto populate this with the currently logged on user. Session("UserId") does not appear to work here, again it works fine on the Add page.
Can you help?
Thanks

Andy

Sergey Kornilov admin 1/7/2007

Andy,
default values designed to work on Add page only.
You need to use BeforeEdit event and the following code:

dict("UpdatedBy") = Session("UserID")

dict("UpdatedTime") = Now()