Author Archives: Hitesh Kumar

About Hitesh Kumar

A Software Developer with more than 5+ years of rich experience in Software Development in Microsoft Dot Net Technology.

How to encode URI components in javascript?

JavaScript provides an encodeURIComponent() function to encode uri components. This function encrypt the special characters provided in the url such as “space , / ? : @ & = + $ #“. Syntax encodeURIComponent(uri) Example Html Result How to encode URI components in javascript? URI: codesolution.org/calculate-time-between-two-dates/ Encoded URI: codesolution.org%2Fcalculate-time-between-two-dates%2F Try it

Calculate time between two dates

Using moment.js, We can calculate time between two dates in jquery. JavaScript Html Result Calculate time between two dates Start Date Time : Jul 29, 2017, 12:25:00 End Date Time : Aug 30, 2017, 22:30:00 Hours : 778.0833333333334 Minutes : 46685 Try it

Calculate days between two dates in jquery.

Using moment.js, We can calculate days between two dates in jquery. JavaScript Html Result Calculate days between two dates Start Date : Jul 29, 2017 End Date : Aug 30, 2017 Days : 32 Try it

Fizz Buzz game C#

Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.

Update List from another list C#.

To update a list from another list, Here is the Syntax. Syntax Example 1. Create Student model 2. Create Student List as listStudents 3. Create Student Marks as listMarks 4. Now Update listStudents from listMarks

Convert a list of string to comma separated string C#.

Convert a list of string to Comma Separated String. String.join method is used to concatenate a list of string, Using a specified separator between each string. Syntax : String.Join(string Separator, String[] Values); Example :

Multiple actions were found that match the request Web API.

When we create a Web API, it creates a default route “api/{controller}/{id}” in WebApiConfig.cs file. Action name is not defined in the route. Web API by default serves to HTTP verbs Get, Post, Put, Delete with optional parameters. Web API identifies the action with http verbs. If we have more than one action method with Continue Reading…

What is WCF Reliable Messaging?

WCF Reliable Messaging makes web services more reliable. It addresses the following problems: A call to a web service does not make because the networks are not perfectly reliable as they suffer congestion and may drop signals. OR the service response does not make it back to the client. If I make multiple calls to Continue Reading…

CRUD Operations using WCF Rest API

This Tutorial will explain how to implement crud operations using WCF Rest API. Open Visual Studio 2012. Go to create new project tab. Select “WCF Service Application” from WCF templates and name it WCFCrudService. using WCF Rest API Crud operation are performed by GET – To Get data from database POST – To Insert data Continue Reading…

@Html.Action vs @Html.RenderAction in Asp.Net MVC

@Html.Action @Html.Action returns string. Syntax : @Html.Action(“Action”,”Controller”). Pass parameter with Action method Syntax : @Html.Action(“Action”,”Controller”, new {ParameterName=ParameterValue}). It is slower as compared to @Html.RenderAction. It’s result can be manipulated before rendering to the output stream. Manipulation : @{ var data= Html.Action(“Action”,”Controller”, new {ParameterName=ParameterValue}); } @data I am Software Developer. Use when data length is small or need to manipulate result Continue Reading…