Asp.Net MVC Exploring Controllers in-depth Part 9

Asp.Net MVC Exploring Controllers in-depth Part 9

Asynchronous Controllers

 

  • The async actions are useful only when you are performing I/O bound operations such as remote server The benefit of the async call is that during the I/O operation, no ASP.NET worker thread is being used.
  • The asynchronous controller enables you to write asynchronous action
  • Suppose we have three operations which take 200, 500 and 800 milliseconds. With the synchronous call, total response time would be slightly more than 1500 milliseconds. However, if the calls are made asynchronously (in parallel), total response time would be slightly more than 800 milliseconds, because that is the duration of longest task/operation. Continue reading “Asp.Net MVC Exploring Controllers in-depth Part 9”
Please follow and like us:
0

Asp.Net MVC Exploring Controllers in-depth Part 8 – Bestdotnettraining

Asp.Net MVC Exploring Controllers in-depth Part 8 – Bestdotnettraining

Cancelling Filter Execution

  1. You can cancel filter execution in the OnActionExecuting methods by setting the Result property to a non-null value.
  • Any pending OnActionExecuted and OnActionExecuting filters will not be invoked
  • Invoker will not call the OnActionExecuted method for the cancelled filter or for pending
  • The OnActionExecuted filter for previously run filters will
  • All of the OnResultExecuting and OnResultExecuted filters will
  1. You can cancel filter execution in the OnResultExecuting methods by setting the Cancel property.
Please follow and like us:
0

Asp.Net MVC Exploring Controllers in depth Part 7. Best Dot Net Training

Asp.Net MVC Exploring Controllers in-depth Part 7. Best Dot Net Training

Filter Overrides in ASP.Net MVC 5.X

Filter Overrides in ASP.NET MVC 5 are very useful when we are implementing a global or controller level filter and we do not want to apply an action filter on some Action methods in the controller. This feature is useful for removing the headache of applying filters for each and every action where we need to exclude only a few actions.

  • Authorization filters
  • Action filters
  • Result filters
  • Exception filters

We have five type filter overrides corresponding to this:

  • OverrideAuthenticationAttribute
  • OverrideAuthorizationAttribute
  • OverrideActionFiltersAttribute
  • OverrideResultAttribute
  • verrideExceptionAttribute

Continue reading “Asp.Net MVC Exploring Controllers in depth Part 7. Best Dot Net Training”

Please follow and like us:
0

Asp.Net MVC Exploring Controllers in-depth Part 6 – Bestdotnettraining

Asp.Net MVC Exploring Controllers in-depth Part 6 – Bestdotnettraining

Example: UserAgent ActionFilter

Learn MVC to build web apps using the Model View Controller pattern. ASP.NET MVC 5 provides this functionality to the ASP.NET framework as an alternative to the Web Forms pattern. (Though WebForm is considered to be matured for web application development, MVC design patterns gained popularity due to its exclusive features which makes it the first choice of large-sized enterprises.) Learning ASP.NET MVC from BestDotNetTraining would let you stay updated with technologies used for developing web applications.

 

Following demonstrate how we can change the View based on the type of browser

 

Please follow and like us:
0