Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 17th, 2006, 02:36 PM
Authorized User
 
Join Date: Oct 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Guys this is just what I am looking for but I need to do it in C# code. I am using the LoginControl from ASP2 which is great and my user is logging in but then I need to display some data from a database with their username as part of the where clause. I am trying to assign the forms user to a label.text or textbox.text. Can anyone help?

Ryan
 
Old February 17th, 2006, 02:46 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Assuming your user is logged in, you can do this:

Label1.Text = Membership.GetUser().UserName;

HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Export Membership Profile Data vickyc ASP.NET 2.0 Professional 0 October 11th, 2007 04:12 PM
Accessing Programatically xlr8 BOOK: Beginning C# 2005 Databases 1 April 30th, 2007 08:56 AM
Accessing browser (IE) cache programatically baburman General .NET 7 October 24th, 2006 09:50 AM
Migrate user data to new membership model relaytest49 ASP.NET 2.0 Professional 2 May 24th, 2006 09:44 AM
Using data programatically jasongorringe ASP.NET 2.0 Basics 1 February 10th, 2006 02:42 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.