Start-up code using WebActivator in MVC application

Read full post on Falafel blog

WebActivator allows us to execute a code long before application start-up. There may be requirements when you need to load external assemblies or instantiate a particular object before the application start up. You need to make sure some codes execute before the codes inside the App_Start folder and the global.asax file. To do this WebActivator should be used.
You can add the WebActivator package using NuGet.

Let us consider an example in an MVC application in which we want to call a method of a class before  the execution of the application. To do this follow the steps below:

  • Attribute the class with WebActivator
  • Pass the type of the class
  • Pass the name of the method to be executed

Read full post on Falafel blog

One response to “Start-up code using WebActivator in MVC application”

  1. […] for duplicate items in Kendo UI ListView before adding the item from Kendo UI AutoComplete and Start-up code using WebActivator in MVC application and Check User exists in a Role in ASP.NET Identity 2.0 […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a website or blog at WordPress.com