Igor Kitsula - Developer

A Programmer Reference


Why ReturnUrl from login page doesn’t work and how to fix it

Common mistake or misunderstanding why login action doesn’t have ReturnUrl value, even if there is string parameter with value in the page URL. If you think about it more, you will get it – ReturnUrl  is in the page URL but not in the action URL of the login form. The trick is to pass this parameter to the form inputs or action URL parameters be submitted with login form request. It’s very easy to do with MVC.

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...