CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> .NET

 Inserting UserID into a hidden field

Print topic Send  topic

Author Message
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
View profile  Send private message
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")
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.