In this article we will learn about the Create Exception Log in Text file using asp.net C# mvc

This article provides a sample code of sending an E-Mail using the SmtpClient class in an ASP.Net MVC application.

This article shows how to display the number of online users in ASP.NET or how to display online current user on your website or how to show online current users on your web page in asp.net MVC .

In this article we will explain how to upload image in mvc or how to save image in mvc or how to upload image using ajax in mvc on file upload change event jquery.

Let us implement these in a sample Application to upload file in ASP.Net MVC application. Open Visual Studio and click on New Project link.

ASP.NET MVC HandleError attribute provides a built-in exception filter. It can be applied over the action method as well as a controller. However, we can add it at the global level for handling exception in controller and action level. While creating our application, it is automatically included within the Global.asax.cs and registered in FilterConfig.cs, as shown below.

In this method we can override the “OnException” event of the controller and set the “Result” to the view name. This view gets invoked when error occurs in this controller. In this case, we must intimate the filtercontext that we have handled the error. For this, we need to write the below line of code.

This is the default way of handling exceptions where we write our source code into the try block and catch the exceptions in the catch block. However, you can have multiple catch blocks for a try block. Even you can have Try-Catch blocks inside a Try block

In mvc Partial view is just like a web User Control in ASP.NET web form technology. Partial views are used to componentize Razor views and make them easier to build and update. Partial views can also be returned directly from controller methods. In this case, the browser still receives text/html content but not necessarily HTML content that makes up an entire page.

Here we'll create this scenario in the ASP.NET Web Application based on the MVC Project Template using jQuery. In this article you will learn to create the MVC application and work with the controller and view in it. We'll also use the Razor syntax in the MVC Views

Page 1 of 3