: Hamden
: London
: 14 May 2012 02:36 PM
: 13 February 2015 21:39
Process manager with a reputed organization, Fond of learning new features and technology related to C#, ASP.Net, SQL Server, MVC etc.I like to help others, if I can
29 Articles

Overloading and Overriding in C# with example

In my early day career in many interviews I asked same question, what is overloading and overriding so decided to write this small article which may help someone. We will see here in detail about the overloading, overriding and then differences between them. --- **Overloading:** --- is the mechanism to have more than one method with same name but with different signature (parameters). A...   On 31 Mar 2013  Viewed: 24,088

Insert, update and delete in asp.net gridview step by step

We will do insert, update and delete functionality in a GridView with modal popup, we will proceed step by step to learn how easily we can complete this functionality in any project. We will try to create a basic user page where you can see all the users in a grid with paging and buttons to add new user, update an existing user and delete any existing user with confirmation box. We will always...   On 01 Sep 2013  Viewed: 15,517

Send email in background thread in C# aps.net

How to send email in a new thread in asp.net by using Gmail account or any other account or you can say a page where we can test out all the settings like SMTP Server, Email From, Email To, Email Password, Port Number, Email DeliveryMethod or Secure Socket etc. In this article we will see how to send email in background thread with CCed and BCCed functionality. Here is the page...   On 13 Sep 2013  Viewed: 12,261

Linq inner join, left outer join on two lists in C# with example

Joining two generic lists in linq is tricky, in this article we will see how we can join two lists by using inner join and then by using outer join. Using inner join is quite similar to sql inner join but outer join is a little different, so we will see it with example code as well as records (output). So let's check the data, two generic lists which we will use in our example List1:...   On 25 Sep 2013  Viewed: 9,124

Get parent element by jQuery/JavaScript

We can use JavaScript to get parent element or jQuery to get parent element but which one would be best for you is up to your need and familiarity with JavaScript and jQuery. In this article we will take different conditions and examples to show how jquery finds parent element and same case with JavaScript. First we will see the simplest form of parent of any element
...   On 06 Apr 2013  Viewed: 5,903

Upload multiple image in multiple size with progress bar in asp.net

In asp.net there is not control to select multiple files and upload them once with progress bar, so we will use a small third party DLL to achieve this functionality. We will use Flajaxian FileUploader, you can download it from [http://www.flajaxian.com][1] We will create three different images of size 100X100, 400X400 and original file, you can say thumbnail, medium size image and original...   On 12 Jul 2012  Viewed: 4,595

Ajax fill country state and city without postback in asp.net

Country will be filled on page load and once user will select any country we will fill states from that country and again when user will change state we will fill city for that state without postback ( asynchronously) with the help of update panel in asp.net. Create three methods to fetch country, state by country and city by state CountryRepository.FetchCountries(); to fetch country...   On 04 May 2013  Viewed: 3,132

How to create a single thanks page for entire controller in MVC

Sometimes we need a thanks page say we have user registration, change password, activate account functionality in our application then we need a thanks page after registering with our site, to say thanks for registering with us or showing confirmation that your password is successfully changed or your account is successfully activated. So do you think we need three different view for these...   On 30 Jun 2013  Viewed: 2,085

SQL ISNULL, IFNULL and NVL function with example

ISNULL in Sql Server is uded to check and return alternate value if value is NULL, while to only check the NULL value, we can us IS NULL with space, in MySQL and Sqlite, for same functionality, we can be use IFNULL and in Oracle we can use NVL. Suppose we want to return 0 if column value is null then we can use select ISNULL(columnName, 0) from table_name Column type and alternate...   On 31 Aug 2013  Viewed: 2,039

Linq dynamic order by a list with example

Sort a list dynamically is easy, in this article we will create a class to sort the source dynamically by passing source, column and sort order. Let’s write our class and then we will see it with example, create a new class DynamicSort public static class DynamicSort { public static IQueryable OrderBy(this IQueryable source , string columnName, bool...   On 07 Sep 2013  Viewed: 1,810

enum in C# and conversion

An enumeration type (also known an enumeration or an enum) provides an efficient way to define a set of named integral constants that may be assigned to a variable to make programming clear, understandable and manageable. There are ways of using, like how to use enum in switch and case statement, how to convert a text to enum or number to enum to compare, we will discuss here all these points in...   On 27 Mar 2013  Viewed: 1,717

Polymorphism in C# with example

Polymorphism is derived from two Latin words, 1. Poly means many 2. Marphose means forms. By using inheritance, a class can be used as many types, say we have a Person which may be a Professor, may be a Student, may be Clerk. So in this article we will see some example of Polymorphism. When we derive a class from base class it inherits all the method, properties, fields and events of the base...   On 01 Jun 2013  Viewed: 1,663

Social media sharing buttons without javascript

Social Media Sharing Buttons Without JavaScript I was looking for code to add social media buttons to share my blog on different sites like facebook, twitter, google plus, tumbler and email, I search many websites but could not found any good article which can help to add these buttons without using JavaScript. Finally I checked the code of different sites and try to copy the rendered code and...   On 29 Dec 2014  Viewed: 1,501

Method overloading in C# with example

Method overloading means having different methods with same name but with different types of parameters or number of parameters also known as static polymorphism. In this article we will try to understand what is method overloading and how we can overload a method with example. Suppose we have a class Calculate which can have a method Add by using two integers, two double, any number of...   On 19 Jul 2013  Viewed: 1,156

ASP.Net page life cycle events, orders and purpose

ASP.NET Page Life Cycle order and events Page life cycle is very important concept to understand while working with asp.net, what are the stages we can read the view state values and what is the last event where can write back our view state again. When to load the dynamic controls and when to check the values of dynamically added controls, It is impossible to work without knowing the basics of...   On 24 Jan 2015  Viewed: 1,047

Action filter basics in ASP.Net MVC

Action filter in MVC is from very first version. Sometimes we want to perform logic before or after calling the action method, to support this MVC provides action filters. Action filters are used as attributes. Filter can be applied on action method or directly to the controller. Suppose we want an action method (say Edit) to be viewed only by authorized users then [Authorize] ...   On 13 Jul 2013  Viewed: 884

Convert string to an enum type in .net

Sometime we need to convert string to an enum type, say I need to store my enum value into viewstate then we cannot store enum or any object to viewstate so converted that to string and store it, and on postback need to read the viewstate and convert to enum, so how to convert a string into enum? We will see this in this article. Let’s say our enum is like this: Public enum ReportType ...   On 21 May 2013  Viewed: 777

Convert image to base 64 string and base 64 string to image in c#

Converting and image to base 64 from an image or from a path or converting a base 64 string to an image is quite easy. We will use MemoryStream to convert them. We will use two simple method one to convert the image to base 64 string and other to convert the base 64 string to image. Image can be saved wherever you want or show them anywhere on the page Code to convert the image into base 64...   On 01 Jan 2015  Viewed: 707

Use XSLT to create menu from database

In some situations we need to create website menu from database, say our application have ability to create pages so that must also need to have a menu item to go to that page. So how to create menu with all those nice CSS and other settings, I think XSLT is best to use in these situations. Let’s see what we would need to create our menu 1. Procedure to get data from database in xml...   On 16 Mar 2013  Viewed: 700

Change column name and data type in Sql Server

How to change column name and data type of a column cannot be done in one statement but first we need to change the column name and then data type, In this post we will check many other things like how to change data type of a column, how to drop a column, how to add a new column, how to make a column not nullable etc. So first we will see how to change a column name as well as data type of...   On 05 May 2013  Viewed: 628