Sunday, January 22, 2017

Display message when user is not authorized in mvc

In this post I will show how to Display Error message when user is not Authorized, Continuing the previous POST i.e.,
Customizing Authorize attribute or Role based Authentication or Authorization in MVC

Previously I had shown how to....
DataTables in MVC:
OutPut:

Customizing Authorize attribute or Role based Authentication or Authorization in MVC

As the TITLE says Customizing Authorize attribute, In this post I will show how to create a Customized Authorize attribute and use it. This is used to redirect the user to Home Page when he/she is authenticated and not authorized i.e, when the Authorize attribute generated 401 response it will redirect to Login page.
Previously I had shown how to...
DataTables in MVC:
AngularJS:
By creating a CustomAuthorize class which inherits AuthorizeAttribute we can redirect the user to home page instead of a login page.
How to use?
  

[CustomAuthorize(Roles = "Admin")]
public ActionResult Index()
{
 return View();
}

Friday, January 20, 2017

How to create Extension Methods in C#

In this post I will show you how to create Extension Methods for Date Format (dd-MM-yyyy).
In the previous posts I had shown How to...

DataTables in MVC:
AngularJS:














Ajax helper Based Search in MVC

In this post I will show how to use Ajax Helper for searching as shown below.
Previously I had shown How to use
DataTables:  Code First Migrations in MVC 5Jquery DataTable in MVCJquery DataTable multisearch paging and Sorting in MVC server sideJquery DataTable paging, Sorting and Multi search with datepicker in MVC server sideCascading DropDowns in Asp.Net MVC


Out Put:














Thursday, January 19, 2017

AngularJS with Web Api in Asp.net MVC using Token based Authentication

Here in this Post I will show how to use Token based Authentication using AngularJS and Web Api 2 in Asp.Net MVC. Previous posts I had shown how to
DataTables in MVC:

AngularJS:




















Datatable Exporting with AngularJS and asp.net mvc

Continuing the previous Posts in AngularJS
In the previous posts I had shown

DataTables in MVC:
AngularJS:
Image and video hosting by TinyPic

















Datatables Column Filter with AngularJS and asp.net mvc

Continuing the previous Post from HERE
In the previous posts I had shown
DataTables in MVC:

AngularJS:

Image and video hosting by TinyPic