My guess is you should try to place the code below under protected void Application_Start() in the Global.asax.cs. This way, you database connection will always be Initialized before everything else.
if (!WebSecurity.Initialized)
WebSecurity.InitializeDatabaseConnection("DefaultConnection",
"UserProfile", "UserId", "UserName", autoCreateTables: true);
Maybe this Pro Asp.Net Mvc 4 will help you set up your testing project. There is also an MVC 3 version, but they will pretty much say the same thing. They suggest to use Moq Library, and its helped me in the past.
ASP.NET Web API allows you to create RESTful services and work with JSON data. Normal ASP.NET MVC also allows you to send JSON between your client and server, but Web API is the future. You could use normal ASP.NET (web forms) or ASP.NET MVC, MVC allows you to have a better organisation of your presentation logic and is just awesome. When you use Web API along with ASP.NET MVC, web API will be in charge of dealing with your data, and your asp.net MVC will be in charge of serving up your views. There are tonnes of material out there on ASP.NET MVC and Web API, so I won't bother posting any here. Finally, if you want your application to be more interactive and are focusing on good UX, then you could integrate as much AJAX as possible into your apps and even better make use of javascript frameworks such as knockout to create a highly responsive UI. Here is a good write up on using Web API with Knockout.js. Also a must read book for aspiring asp.net MVC developers. The book covers unit testing with Visual Studio and Moq and Dependency Injection with Ninject briefly but well, you could unit test your javascript with Qunit, though it has nothing to do with .NET specifically.
Yes, you will find it in awesome book Pro ASP.NET MVC 4 on page 101 (razor) and 183 (paging). It is the must read book!
http://www.amazon.com/Pro-ASP-NET-MVC-Adam-Freeman/dp/1430242361/ref=sr_1_1?ie=UTF8&qid=1381864006&sr=8-1&keywords=asp.net+mvc
Pro ASP.NET MVC 4 (Professional Apress)
http://www.amazon.com/Pro-ASP-NET-MVC-Professional-Apress/dp/1430242361
this series is great.
My guess is you should try to place the code below under
protected void Application_Start()
in theGlobal.asax.cs
. This way, you database connection will always be Initialized before everything else.Maybe this Pro Asp.Net Mvc 4 will help you set up your testing project. There is also an MVC 3 version, but they will pretty much say the same thing. They suggest to use Moq Library, and its helped me in the past.
ASP.NET Web API allows you to create RESTful services and work with JSON data. Normal ASP.NET MVC also allows you to send JSON between your client and server, but Web API is the future. You could use normal ASP.NET (web forms) or ASP.NET MVC, MVC allows you to have a better organisation of your presentation logic and is just awesome. When you use Web API along with ASP.NET MVC, web API will be in charge of dealing with your data, and your asp.net MVC will be in charge of serving up your views. There are tonnes of material out there on ASP.NET MVC and Web API, so I won't bother posting any here. Finally, if you want your application to be more interactive and are focusing on good UX, then you could integrate as much AJAX as possible into your apps and even better make use of javascript frameworks such as knockout to create a highly responsive UI. Here is a good write up on using Web API with Knockout.js. Also a must read book for aspiring asp.net MVC developers. The book covers unit testing with Visual Studio and Moq and Dependency Injection with Ninject briefly but well, you could unit test your javascript with Qunit, though it has nothing to do with .NET specifically.