AspNetMembershipProvider for MySQL

by Cliff 13. February 2011
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.

.Net | MVC | MySQL

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

by Cliff 26. January 2011

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 conditionally render a partial view

by Cliff 15. March 2010

I was looking for a clean way to conditionally show a block of html and came across this post

It oulines a really clean way to conditionally render a partial view while avoiding having if/else logic directly in your view.


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

by Cliff 5. December 2009

I have been doing some work on a 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... mvc IIS 7 404 erro

by Cliff 7. October 2009

If you are having issue getting an 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=, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
                <add name="UrlRoutingHandler" preCondition="integratedMode" verb="*" path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler, System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />


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


Cliff Gray's Info

Cliff Gray

E-mail me Send mail



<<  February 2023  >>

View posts in large calendar


Download BlogEngine.NET

Download at CodePlex


The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2023