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.
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:
- 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
- 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
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.
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...
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" >
<add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=18.104.22.168, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="UrlRoutingHandler" preCondition="integratedMode" verb="*" path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler, System.Web, Version=22.214.171.124, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
I found the below articles to be very helpful in troubleshooting the issue I was having.