November 5th, 2015

Export Data to Excel (.xls, .xlsx) in ASP.NET – C#

In this article, we will see different ways to export data to Excel from a web application. It is very common task for web developers. Here are different approaches to do it in ASP.NETC#:

Approach 1:

Using the Excel PIA (primary interop assemblies) to generate a spreadsheet server-side.

It needs Microsoft Office suite installed on your server which is not good. So it is NOT recommended.


Realtime Voting App With React.js and ASP.NET SignalR

CRUD Operations with AngularJS + Sails.js Rest APIs

August 27th, 2015

CRUD with Multiple File Upload, ASP.NET MVC 5 and EF 6

This tutorial explains the following things in ASP.NET MVC:
1. How to upload multiple files using HTML5 multiple file input with additional model data.
2. How to save files to a specific path on the server (Not in database).
3. How to allow to upload file with same name. Different users can upload files with same name.
4. How to download the uploaded file.
5. How to manage files in edit mode.
6. How to use Entity Framework for CRUD operations with parent child table structure.

July 26th, 2015

Get Social Media (Facebook, Twitter, YouTube, Google+) Followers Count Using PHP

Each social media provides their own widget to display followers count, but their user interfaces are different and so much javascript in the code. So I decided to get the count on server side using PHP, cache it and show it as I want. This post explains to get Twitter followers, Facebook fans, YouTube subscribers and Google+ page/profile followers count, to cache the results and generate HTML to display them.

June 24th, 2015

Embedding YouTube Videos with Fast Loading and Responsive View

The embedded YouTube videos make your page heavy and slow down your page load times. The page load time is important factor for a web page because
– Site Speed improves user experience. There are different surveys and case studies which show poor experience with slow sites.
– In the era of Mobile, Tablet.. devices, site speed must be good to get accessed everywhere.
Google also cares about site speed for search criteria.

So, this post explains how to embed YouTube videos with fast page loading for better user experience.

May 21st, 2015

A Better Way To Manage ASP.NET Session With Generic Wrapper

Before we get started, let us see the general way to use Session in ASP.NET

if (Session["UserName"] == null) 
    LabelUserName.Text = "Anonymous"; 
    LabelUserName.Text = (string)Session["UserName"]; 

You can feel some drawbacks e.g. to check null reference, type safety, to cast object..etc.

Now add following class and see how it solves the issues: