MVC Membership – Preview 3

// July 2nd, 2008 // MVC

Tonight we posted a new release of the MVC Membership Starter Kit. This release is an update to migrate the starter kit to the new Preview 3 release of the MVC framework. While several bugs have been squashed, no major new functionality has been added.

If you couldn’t wait and downloaded the source prior to the official Preview 3 release, you’ll still want to download tonight’s official release as several important issues have been addressed.

Bug Fixes in 1.3:

  • The System.Web.Abstraction, System.Web.Mvc, and System.Web.Routing DLLs being used prior to tonight were from an earlier Preview 3 release and were not signed by Microsoft.
  • Routing ambiguities caused a 404 error to occur when a user enters an incorrect username/password combination on the login page.
  • Several errors were occurring on various password recovery screens which created a bad user experience.
  • Errors on the administration section’s Create User and Display User pages were preventing that functionality from working at all.

Thanks for all of the interest everyone has shown in this project and thanks to Maarten and Greg for their contributions; especially to Maarten as he did most of the grunt work in upgrading our code base to Preview 3. Please send any feedback you have our way, we’d love to hear it!

Kick It on DotNetKicks.comShout It on DotNetShoutOuts.com

17 Responses to “MVC Membership – Preview 3”

  1. Tony Bermudez says:

    I am getting the following error message after building the new release and trying to login with the id Administrator and password of password!1.

    Server Error in ‘/’ Application.
    ——————————————————————————–

    The resource cannot be found.
    Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

    Requested URL: /Security/PasswordRecovery

    Any idea?
    Tony

  2. Troy Goode says:

    Tony,

    How are you coming by that page? After loading the website, you click on the login page, submit the form and wind up at ~/Security/PasswordRecovery?

    If you could help me reproduce the issue I’d love to help you fix whatever is causing it.

  3. Raluca says:

    Tony,

    I had exactly the same problem a few days ago…
    The problem was with the version of some routing assemblies referenced in web.config, namely: httpModule UrlRoutingModule, module UrlRoutingModule, handler UrlRoutingHandler. In my case the version of these assemblies was 3.5.0.0. After changing them to Version=0.0.0.0 everything was ok.

    Hope this helps,
    Raluca.

  4. seanshih says:

    Dear Troy

    I have a problem shifting the database from ASPNETDB to my MS-Sql2005. I saw all the “create” and “update” functions link to System.Web.Security, but I could not find any DB-link in your sample code. Can you give me a hand to figure out where the setting is?!
    As me as a beginner, this one kills me.
    as you as a pro. I guess this is a very basic question
    Thank you for your hepl

    Sean Shih

  5. seanshih says:

    Hi Tory

    Thank you for oyur quick reply.
    I have another 2 questions:
    1. Is that possible I use LINQ to replace all DB access?
    2. If I want to change or add the columns in DB Table, what should I do?

    Thanks again

    Sean

  6. Troy Goode says:

    Hi Sean,

    Data access for membership is done via the Asp.Net Membership Provider. This abstracts out the data access (which could be XML, Oracle, etc), so no, you shouldn’t use LINQ to access that data.

    You also should not manually modify the db tables for membership, as the schema technically could be changed in future version of ASP.Net. I recommend creating a separate database (separate from the AspNetDb db) to store your extra data in (which you can then map to each user’s Guid via user.ProviderUserKey).

  7. VB says:

    Hi Troy,

    When are you guys planning to come out with a new release supporting MVC Preview 4?

  8. Troy Goode says:

    @VB:

    Our Preview 3 release actually [i]works[/i] with Preview 4. That said there are some major changes in Preview 4 that we’ll be making use of going forward (such as the new authorization and error handling filters). I’m currently planning to release two versions of the starter kit for Preview 4.

    The first release I should have out tomorrow and simply removes the front-end controller & views (which are now part of the default MVC project template) as well as switching over to the new [Authorize] and [HandleError] attributes.

    The second release (and all subsequent releases of this project) will focus on improving the administrative interface for managing users using the new MS Ajax goodness. I’ll also likely include the OpenID login and Windows Live login controllers & views back in at this point. I’m targeting the end of next week for this release.

    Now that Preview 3 has subsumed much of the MVC Membership Starter Kit’s functionality, where would you like to see the project go?

  9. CuriosMe says:

    Hi Troy,

    I had similar problem as one of the readers and the link you pointed for configuring SQL Server for membership does not work for me. I pointed the web.config to my own DB (instead of aspnetdb) but it still looks in the default aspnetdb.
    here is my connection string:

    Please advice

  10. sam says:

    Kuddos on your work Troy.

    I have a question that I can’t seem to find an answer for. How can I use jquery and asp.net’s membership together? I can pass in credentials…but then how do I keep a “session” open with json request/responses?

  11. seanshih says:

    Hi Troy

    I have a question that I want my URL look like this

    http://localhost:111111/admin/user/getuser/123
    channel = admin
    controller = user
    action = getuser
    id = 123

    and i saw following line in Global.asax.cs
    “{controller}/{action}/{id}”, // URL with parameters

    is that possable to re-write the route to fit my request??

    Thanks again

  12. Troy Goode says:

    @CuriosMe: Make sure you update the Membership Provider in your web.config to use the new connection string you’ve created. By default it uses a connection string named “LocalSqlServer”.

    @Sam: I responded to your question on CodePlex as well. I’m not entirely certain what you are asking here. Everytime you make a request to the server that user’s session should be extened by the timeout period (default of 15 minutes). Does that answer your question?

  13. Troy Goode says:

    @seanshih: Absolutely. Create a new route that looks like “{channel}/{controller}/{action}/{id}” and make sure that whatever actions it routes to accepts a parameter named “channel”.

  14. GRom says:

    Hi Troy

    I am use Preview 3
    Can you help me
    Can I use HandlerError and 404 error

  15. GRom says:

    ok, thank’s
    after updating all work correct