Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6644077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:07:31+00:00 2026-05-26T00:07:31+00:00

I hope i’m not bithering with my many questions… i’m creating users in the

  • 0

I hope i’m not bithering with my many questions…

i’m creating users in the ASPNETDB.MDF database with the asp.net configuration.

i have a client MVC, and i want when a client is created, edited, or deleted, it must dispaly the user_name and last_user_name of the user that performed the action. These two properties r in the client model. i want my controller to only deal with the ID(PK) of the users, and not their names. I only know how to make the controller work with the user names. How do i ensure that any functionality is done with the id but the display is the user_name? Here is my create method in my clientcontroller

    [Authorize]
    public ActionResult Create()
    {
        var model = new title
        {

            create_dt = DateTime.Now,
            last_maint_dt = DateTime.Now,
            row_version = 1,
            status = "ACTIVE",
            user_id = System.Web.HttpContext.Current.User.Identity.Name,
            last_user_id = System.Web.HttpContext.Current.User.Identity.Name

        };

        return View(model);
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T00:07:32+00:00Added an answer on May 26, 2026 at 12:07 am

    If you are using the default ASP.NET Membership Provider you can find the user GUID for an account by accessing System.Web.Security.Membership. Then you can use the GetUser() method and pass it the username as an argument.

    //Get Current User ID
    var user = System.Web.Security.Membership.GetUser(User.Identity.Name);
    
    if (user != null)
    {
        string id = user.ProviderUserKey.ToString();
    }
    

    And if you have the GUID and want the Username

    var user = System.Web.Security.Membership.GetUser(id);
    if (user != null)
    {
        string username = user.UserName;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hope this question is not stupid since I am an amateur web designer. I
Hope someone can shed some light on this... I, and many other developers in
Hope someone can help, I'm not a programmer, but have been interested in exploring
hope all of you doing well. I have small question in C#.Net. actually i
Hope someone can help. Apologies for not being well informed on htaccess. I have
Hope this is not a stupid question. For Regression testing, I wrote a small
Hope my question does not pose as too wide. So I try to frame
Hope my title is not too confusing. Please let me know if there is
Hope some one can help. Using the DDay.iCal version 1.0.1.490 with .net version 2
Hope there is not an answer yet (I've checked). Can I introduce a login

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.