MVC Custom Error Pages (Log to database with Log4Net and notify by email)
MVC Custom error pages (log to database with Log4Net and notify by email)
There is a lot articles in web how to create and use custom error pages. I tried to implement one more solution and give you my example how to handle and log errors on website using Log4Net library and notify about error by email.
Read more...
Using jQuery to submit ASP .NET MVC form
Simplest, easier and nice method to submit MVC form using jQuery AJAX:
$("formMapMarker").submit(function(e) {
if ($("formMapMarker").valid()) {
$.post($(this).attr("action"), $(this).serialize());
}
e.preventDefault();
});
Read more...
All about MVC validation with jQuery or Validate model with Data Annotations using jQuery
There are a lot of articles about validation in MVC. I’ve tried all of them and tried to find optimal and nice solution to validate model defined with Entity Framework, using Data Annotation attributes and have client-side validation related to these attributes using jQuery validation plugin. Too much? :) I don’t think so. Here is the solution.
Read more...
Custom Role Provider for MVC
In previous article I explain how to create Custom Membership Provider to authorize user and protect controls and pages. But what if you want to show or protect some area, controller or page for specific group of users? For example allow access to Admin Panel only for admins.
Read more...
Custom Membership Provider for MVC
.NET Framework allow you authorization engine based on two layer security: users and roles. Most popular is SQL Membership Provider and it contains methods and properties specific to using SQL as a data store for membership information. But for standard Membership provider you should create separate database. To use users or contacts information from your DB for authentication users with standard .NET form authorization you can create Custom Membership Provider and Custom Role Provider. Today we will create simple Custom Membership Provider and I’ll show how to configure it for using in MVC.
Read more...
Routing and Areas in MVC
Nowadays almost every web solution has backend management system like Admin Panel, Control Center, Dashboard, etc. In WebForms you can create folder and put security restriction to it. How about MVC? To achieve same functionality and for even better organization of solution structure you can use Areas. (Organizing an ASP.NET MVC Application using Areas). You can find a lot of information about using areas in MVC. I just want to show you how to use routing rules in solution contains areas.
Read more...