AspNetMembershipProvider for MySQL

If you use ASP.NET (webforms or MVC) you may want to use MySQL as your database.  One nice feature of .NET is the Membership Provider which takes care of authentication and authorization.  You can use MySQL to store the necessary informaion for the membership and role providers.  The below article details how to do this:
 
 
If you run into issues, make sure you copy the MySQLMembershipProvider and MySQLProfileProvider sections from the machine.config to your local web.config.  Once you do this, you should be all set.

MVC3 Upgrade The type 'System.Web.Mvc.AcceptVerbsAttribute' exists in both

If after following the manual upgrade instructions you receive an error such as "The type 'System.Web.Mvc.AcceptVerbsAttribute' exists in both " you should try the following:

 

 

  1. Right click on the web site and view the properties -> and in the references section make sure you do not have duplicate references...if you do, delete one of them
  2. Check you bin directory, if you have System.Web.Mvc.dll in the bin, remove it (you may also need to remove System.Web.Abstractions.dll, etc.


    You should then be able to build 

 

ASP.NET MVC strongly typed view error Could not load type

I have been doing some work on a asp.net webforms website that has been "upgraded" to also include the mvc bits.  One issue I ran into was an error when trying to create a strongly typed view.  I was receiving the below exception:

Parser Error Message: Could not load type 'System.Web.Mvc.ViewPage<MyViewModel>'.

I also was not getting intellisense in my View page when trying to access the Model property.

It sounds like this relates to dll references, and I found the solution at the below link.  

What I did to resolve was to create a new MVC project and then copy the web.config from the Views directory to my older webforms website.  That did the trick...

http://forums.asp.net/p/1378448/2908692.aspx

asp.net mvc IIS 7 404 erro

If you are having issue getting an asp.net MVC web site running on a server with IIS 7 you should check your web.config settings.  I tried a variety of things, searched around the net, and finally found what I was looking for.

After some trial and error, I found that in order for things to work in IIS7 you need the below entries in your web.config, in the system.Webserver section within modules and handlers (leave other items that may already be there). 

<modules runAllManagedModulesForAllRequests="true" >
                <remove name="UrlRoutingModule"/>
                <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
            </modules>
            <handlers>
                <add name="UrlRoutingHandler" preCondition="integratedMode" verb="*" path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
            </handlers>

 

I found the below articles to be very helpful in troubleshooting the issue I was having.

 

 http://chriscavanagh.wordpress.com/2008/03/11/aspnet-routing-goodbye-url-rewriting/