473,386 Members | 1,779 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Getting the membership username

Hi

I have implemented asp.net membership in my app. How can I get the name of
the currently logged user?

Thanks

Regards
Jun 27 '08 #1
2 825
On May 31, 10:54 am, "John" <i...@nospam.infovis.co.ukwrote:
Hi

I have implemented asp.net membership in my app. How can I get the name of
the currently logged user?

Thanks

Regards
Hi

try

this.User.Identity.Name;

Best of luck

Munna
www.munna.shatkotha.com
www.munna.shatkotha.com/blog
www.shatkotha.com
Jun 27 '08 #2
Hi Munna

Thanks. I am trying to do it in the SqlDataSource in a gridview. Not sure
how to do it in this context.

<asp:SqlDataSource ID="EventsSqlDataSource" runat="server"
ConnectionString="<%$ ConnectionStrings:Events %>"
SelectCommand="SELECT * FROM [MyTable] WHERE [Username]
= Me.User.Identity.Name"></asp:SqlDataSource>

Thanks again.

Regards
"Munna" <mu******@gmail.comwrote in message
news:3f**********************************@u36g2000 prf.googlegroups.com...
On May 31, 10:54 am, "John" <i...@nospam.infovis.co.ukwrote:
>Hi

I have implemented asp.net membership in my app. How can I get the name
of
the currently logged user?

Thanks

Regards

Hi

try

this.User.Identity.Name;

Best of luck

Munna
www.munna.shatkotha.com
www.munna.shatkotha.com/blog
www.shatkotha.com

Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: ryan.mclean | last post by:
Hello everyone, I am wondering, can the membership provider be changed at runtime? Perhaps the connectionStringName? I would like to use a different database based on the server the site is...
4
by: =?Utf-8?B?Q2hyaXMgQ2Fw?= | last post by:
I have been having some trouble with implementing a custom Membership Provider. We have a custom data store and business logic that pulls user information. I need some level of functionality...
4
by: AC | last post by:
Hi there. My asp.net 2.0 development website uses roles to control access to sections of my site, configured using the asp.net configuration tool, which is great. Except that isn't available once...
0
by: Fendi Baba | last post by:
I need to implement a login system using Asp.net 2.0 login module( membership provider) with password being case insensitive. I wrote a class Accessmembershipprovider.vb and below is my code....
0
by: =?Utf-8?B?QV9SZXB1YmxpY2Fu?= | last post by:
This is a portion of my Web.config file: <system.web> <membership defaultProvider="SqlProvider"> <providers> <clear/> <add name="SqlProvider" type="System.Web.Security.SqlMembershipProvider"...
0
by: mazdotnet | last post by:
Hi, I'm trying to get the 'User Information' by using the UserId and it doesn't work. This works, MembershipUser membershipUser = Membership.GetUser("username");
0
by: mazdotnet | last post by:
Hi, I'm trying to get the 'User Information' by using the UserId and it doesn't work. This works, MembershipUser membershipUser = Membership.GetUser("username"); tbxUsername.Text =...
0
by: drjack | last post by:
Recently I developed a website using asp.net and SQL Express. The database file is uploaded into App_Data folder. The website is using two membership providers, one is SqlMemership provider with...
1
by: =?Utf-8?B?aGZkZXY=?= | last post by:
Hello, I have a web application that makes use of the SQL Membership and Role providers. My app has admin screens to manage users (membership), roles, and supplementary user data. I have just...
3
by: Cirene | last post by:
I'm creating my own create user wizard. Here's my code... If Membership.GetUser(txtEzUsername.Text).ProviderUserKey.ToString <"" Then Me.lblStatus.Text = "Username is in use. Please select...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.