Contents tagged with ASP.NET

  • Your First MVC 6 and EF 7 Application (Dependency Injection) : Part 3

    In Part 1 and Part 2 of this series you developed a simple database driven application that displays a list of customers and also allows you to modify the customer details. Although the application is working as expected, it relies on the local instances of the NorthwindDbContext to get its job done. In this article we will use the Dependency Injection (DI) features of MVC 6 to inject the NorthwindDbContext into the controller class. Later we will also add repository support in the application.

  • Your First MVC 6 and EF 7 Application (using Empty Project Template) : Part 1

    If you are tracking the progress of ASP.NET 5, you are probably aware that Beta 8 of MVC 6 is now available. Although MVC 5.x is not going away anytime soon, it's good time to get a feel of how MVC 6 application development is going to be. To that end this article explains how a simple MVC 6 application can be developed from ground up using an Empty Project Template.

  • Overloading Controller Actions in ASP.NET MVC

    Method overloading is very common technique used in C# code. Although it works great for normal C# classes, the same can't be said about ASP.NET MVC controller classes. Unlike an ordinary C# class, a controller is dealing with HTTP protocol. And HTTP doesn't understand overloading as C# does. So, in case you wish to use method overloading in a controller you need to consider the ways as discussed in the remainder of this article.

  • Select, Zip and Download Files Programmatically in ASP.NET MVC

    You might have already seen websites that display a list of files to the end user. The user can then select one or more files from the list and request a zipped bundle of those files as a single download. In this article you will learn how to do just that. You will use classes from System.IO.Compression namespace to zip the files programmatically.

  • Four Ways of Handling Multiple Submit Buttons in ASP.NET MVC

    In web forms handling multiple submit buttons on a form is quite straightforward because all you need to do is write the Click event handler of the respective buttons. However, in ASP.NET MVC you need to rely on the plain HTML and / or JavaScript to deal with the situation. To that end this article illustrates four ways of handling multiple submit buttons.

  • Call Controller Actions using HttpClient

    The HttpClient component is typically used to call a Web API. The overall design of HttpClient component is geared towards REST services. However, you can also use the HttpClient to call MVC actions. Of course, the actions to be called must follow the pattern as expected by the HttpClient.

  • Infinite scrolling using jQuery Ajax and ASP.NET MVC

    Web applications such as Facebook and Twitter use a technique known as infinite scrolling or endless scrolling wherein data is loaded on the fly when a user scrolls to the bottom of a web page. There are many jQuery plugins that help you enable such a feature in your web application. However, if you wish to avoid any third-party dependency or have some specific needs, you can add your own infinite scrolling with a few lines of jQuery code and ASP.NET MVC. This article tells you how that can be accomplished.