Handle Exception Using Exception Filter ASP.NET MVC 5

 using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.Mvc;


namespace WebApplication31.Filter

 public class NitishException : FilterAttribute, IExceptionFilter

 

public void OnException(ExceptionContext filterContext)


filterContext.Result = new ViewResult()

{


ViewName = "Error"

};

}

}













Comments

Popular posts from this blog

Uploading Image to Sql Server Image Datatype in asp.net using fileupload Control

๐Ÿ“‰ Study: African Women Face Higher Risk of Job Loss to AI in Outsourcing Sector

๐ŸŽจ Is There a Future for Graphic Designers in the AI Era?