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 74583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T20:22:51+00:00 2026-05-10T20:22:51+00:00

I’m looking at the MVC account controller, and it seems to be from ASP.NET

  • 0

I’m looking at the MVC account controller, and it seems to be from ASP.NET webforms. Is there any good background information on how to use it?

Can you map it to a user database table or is it better to roll your own user management?

How do you make use of it in MVC to restrict what pages a logged in user can view? Do you have to roll all of that on your own?

What resources on the web can help with understanding the ASP.NET Membership?

  • 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. 2026-05-10T20:22:52+00:00Added an answer on May 10, 2026 at 8:22 pm

    I’m looking at the MVC account controller…. it seems to be from asp.net?

    Scott Guthrie explains this quite well in his blog entry about ASP.NET MVC Preview 4. He basically says that the Account Controller from the MVC sample uses the ASP.NET membership provider, so you can use any of those. (I think you can find out more about ASP.NET membership providers on the internet.) If you do not want to implement/use one of those, modifying the application to use your own user management would probably be the best option.

    How do you make use of it in MVC to restrict what pages a logged in user can view? Do you have to roll all of that on your own?

    You can add the Authorize attribute to the controller class or action method. (Same source as above.)

    // Only logged in users can access this controller. [Authorize] public class SomeController : Controller {     #region Not really important for this example. :]     // Maybe rather use a BLL service here instead of the repository from the DAL, but this example is already more verbose than required.     private IStuffRepository stuffRepository;      public SomeController(IStuffRepository stuffRepository)     {         if (null == stuffRepository)         {             throw new ArgumentNullException('stuffRepository');         }          this.stuffRepository = stuffRepository;     }     #endregion      // The authorize attribute is inherited - only logged in users can use the index action.     public ActionResult Index()     {         return View();     }      // Moderators can flag stuff.     [Authorize(Roles='Moderator')]     public ActionResult Flag(int id)     {         this.stuffRepository.Flag(id);         return RedirectToAction('Index');     }      // Admins ans SysOps can delete stuff.     [Authorize(Roles='Admin,SysOp')]     public ActionResult Delete(int id)     {         this.stuffRepository.Delete(id);         return RedirectToAction('Index');     }      // Only joed can change the objects stuff. ;)     // (This is probably bullshit, of course, but I could not make any better example. I blame the fact it is late at night. :))     [Authorize(Users='COMPANY\\joed')]     public ActionResult ChangeId(int oldId, int newId)     {         this.stuffRepository.ChangeId(oldId, newId);         return RedirectToAction('Index');     } } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I am currently running into a problem where an element is coming back from

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.