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

  • SEARCH
  • Home
  • 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 9138419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:15:14+00:00 2026-06-17T09:15:14+00:00

I am using this in c# MVC. I am creating a registration screen for

  • 0

I am using this in c# MVC. I am creating a registration screen for the user with the following fields

   UserName,Password,Role,Location

The Role can be either “Admin” or “User”.

The Location, it can be either “New York” or “Chicago”.

Once the user fills out the form and clicks on Submit, I have the following code:

     .....
     .....
     MembershipCreateStatus createStatus;
     Membership.CreateUser(model.UserName, model.Password, null, null, null, true, null, out createStatus);

    if (createStatus == MembershipCreateStatus.Success)
    {
       FormsAuthentication.SetAuthCookie(model.UserName, false /* createPersistentCookie */);
       Roles.AddUserToRole(model.UserName, model.Role);
       return RedirectToAction("Index", "Home");
    }

I have taken care of Creating the user and also giving that user a role as you can see above. I am not sure how to tie the Location with the User and Role though. What aspnet table would Location go into? Is there a method that already handles something like this?

  • 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-06-17T09:15:15+00:00Added an answer on June 17, 2026 at 9:15 am

    1: You can use built-in ASP.NET Profile to store custom user information

    2: To be more customized and having more control over data manipulation, you will have to create a separate table to store the additional user details. Something along these lines.

    3: IF you think there’s only going to be ONLY ONE FIELD FOREVER, a weirdest way is to use Comment property of MembershipUser. Though not sure how best it fit your needs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been following this nice walkthrough for creating a grid using MVC contrib.
Following this tutorial (http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/handling-concurrency-with-the-entity-framework-in-an-asp-net-mvc-application), I learned how to save data and do concurrency checks
I'm following Steve Sanderson's example from this ASP.NET MVC book on creating a model
I am creating a GUI program using MVC which should look like this.. alt
I'm currently creating an application using ASP.NET MVC. I got some user input inside
I have an ASP.NET MVC form laid out something like this: @using (Html.BeginForm(null, null,
I have this code in mvc 3 razor @using (Html.BeginForm(MyAction, MyController)) { <input type=text
I am using ASP.Net MVC but this probably applies to all MVC patterns in
I'm trying to follow this tutorial using StructureMap : http://iridescence.no/post/Constructor-Injection-for-ASPNET-MVC-Action-Filters.aspx What I'm trying to
In my ASP MVC 3 application, I have this form @using (Html.BeginForm()) { <input

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.