SteveHumby
Posts: 20
|
Posted: 08/06/2006, 6:05 AM |
|
I am having problems trying to assign the UserID session variable to a hidden field.
When a user logs in, they can navigate to a page that allows them to enter a record into a database table. That record requires the users ID to be logged and i planned to do this using a hidden field.
I found in this forum the dbutiliy.userid information, but i couldn't get that working.
Could somebody please suggest the best way to use the UserID variable to help me with my problem.
Cheers
|
|
|
WKempees
|
Posted: 08/06/2006, 10:59 AM |
|
From the Documentation
= DBUtility.UserId.ToString()
http://docs.codecharge.com/studio3/html/ProgrammingTech...Insert.html?toc
VB.Net
Function LastUpdateInfo()
TasksLastUpdateDate.Text = DateTime.Now.ToString()
TasksLastUpdateUserid.Value = DBUtility.UserId.ToString()
End function
'Tasks_BeforeInsert code
LastUpdateInfo()
'Tasks_BeforeUpdate code
LastUpdateInfo()
"SteveHumby" <SteveHumby@forum.codecharge> schreef in bericht
news:844d5e9151cd4b@news.codecharge.com...
>I am having problems trying to assign the UserID session variable to a
>hidden
> field.
>
> When a user logs in, they can navigate to a page that allows them to enter
> a
> record into a database table. That record requires the users ID to be
> logged
> and i planned to do this using a hidden field.
>
> I found in this forum the dbutiliy.userid information, but i couldn't get
> that
> working.
>
> Could somebody please suggest the best way to use the UserID variable to
> help
> me with my problem.
>
> Cheers
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
Diesel
Posts: 43
|
Posted: 08/08/2006, 5:20 AM |
|
On the Beforeshow event of your hidden field add the following:
hiddenfield.Value = System.Web.HttpContext.Current.Session("UserID")
|
|
|
|