Saturday, 23 December 2017

Reading Query string Values in Javascript

Using simple javascript to get the  query string value of URL.


We have URL as 
<a href="DisplayContent.html?id=0"> 0</a>
<a href="DisplayContent.html?id=1">1</a>

To Read the content of URL you can use below method as;


function getParameterValueByName(name, url) {
        if (!url) url = window.location.href;
        name = name.replace(/[\[\]]/g, "\\$&");
        var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
            results = regex.exec(url);
        if (!results) return null;
        if (!results[2]) return '';
        return decodeURIComponent(results[2].replace(/\+/g, " "));
    }

Friday, 8 December 2017

The specified type member '' is not supported in LINQ to Entities.

Getting issue with entity framework for newly added column into database table.

The specified type member '' is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported.



Tuesday, 14 November 2017

Convert Object to DataTable in C#


Converting object to datatable using the C# code, it help in many places like doing the bulk insertion of data to database. There we need to send data in the form of table.
Suppose we have an Employee Class.

public class Employee
    {
        public int EmployeeId { get; set; }
        public string EName { get; set; }
        public int Age { get; set; }
        public decimal Salary { get; set; }
    }

Now instead of creating method for converting the object to datable, we will create a generic extension method which will convert any type of object into datatable.
public static class Utility

Thursday, 2 November 2017

MVC 5 Not working in IIS 7


It’s a common problem when MVC application is not working in IIS but working good with IIS Express.

This is happening as you have installed IIS after Visual studio and due to this reason ASP.net is not registered with IIS.

You just need to register your ASP.net   like below.

Register ASP.NET

64 bit system
C:\Windows\Microsoft.NET\Framework64\v4.0.30319>aspnet_regiis –i

32 bit system
C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis –i

Friday, 27 October 2017

Changing icon on Collapse and Expand Panel


Collapsing and Expanding  for Panel is make very easy by Bootstrap that you can directly achieve using bootstrap.js and Bootstap.css [You can download it from getbootstrap.com]. Than need to write a simple code to change the icon using jQuery. 
Please see below that how to demostrate Changing icon on Collapse and Expand Panel.

It will be look alike below.



Friday, 6 October 2017

Cordova Exit from App

Code to exit from  mobile app using the JQuery Code (Cordova exit app event).

Code for exit from app

  exitFromApp: function () {

        if (navigator.app) {
            navigator.app.exitApp();
        }
        else if (navigator.device) {
            navigator.device.exitApp();
        }

        return false;

    },


Exit from app when click button in android phonegap?

Calling Method

<button name="btnExit" style="background-color:transparent;color: #f82284 !important;font-size:18px;border:0" onclick="app.exitFromApp()" id="btnExit">Exit</button>

Wednesday, 30 August 2017

mvc checkboxlist example


Using the ckeckboxlist to display the records. It is having the items in the form of list box and having the checkbox in list.

It will be appear as like below. Here  I have implemented the checkbox list which will dynamically binding based on dropdown. mvc checkboxlist example
Its like cascaded checkboxlist, mvc checkboxlist multiselectlist.                       

Sunday, 6 August 2017

@html.grid mvc 5


Step by step process to bind MVC.Grid in MVc application
Grid will be display like below

Thursday, 3 August 2017

Generate Property and Methods Tool

You can automatically generate the property and method and insert query which help you to build the backed code faster.


Create an window application like below ;


Sunday, 30 July 2017

logging using nLog

nlog is free logging platform which use in .net, mobile platform. Its very easy to use and integrated with Visual studio Nuget package manager.

1.       Creating console application to check how to use nLog.


2.       Now add the nlog from Nuget package.

Friday, 23 June 2017

Configuring Angular 2 with Visual Studio 2015

Configuring Angular 2 with Visual Studio 2015
1.       Install Node.js from below Path based on your system requirement.

Check which version of node has installed.

It should be 3.x.x.x

Tuesday, 20 June 2017

Program to print pattern in C#

1. Program to print Half Pyramid using *

static void Main(string[] args)
        {
            /// Printing of star pyramid
            PrintHalfPyramid(9);


         }

Sunday, 18 June 2017

GIT Tutorials for Begineers

1.       What is version control and why we need version controls?
-          Version controls are managing the changes on document or files which you are working throughout the application.
-          Whenever you are doing the check-in of your application it will create the snapshots of application and create the version for your files or folders that you worked.
-          You can go back and forth to the different version.


2.       Why do we need of version controls?
-          It uses for collaboration everyone is working on the different task than through version controls  all the code can combined together.

Monday, 12 June 2017

Data structure tutorial for beginners

1.     What is Data structure?

How effectively we are storing the data it’s called as data structure.

Data structure is particular way of storing and organizing data so that it can use efficiently.
Structuring the data which really help us to manage it properly.

Let’s take the example of Dictionary (defined into liner form), Cash book (defined in tabular form)

It is not a language it’s a set of algorithm or process which help to store data effectively.


Data structure à Algorithm à Abstract Data type à Set of rules
Algorithm à Array, Stack, Queue, linked list, tree, graphs

Algorithm (data structure) is divided into two types ::

Thursday, 8 June 2017

Typescript with angularjs tutorial

Chapter 1

1. What is type script ?
Its devloped by microsoft to opt the feature of OOPS into javascript code.  extension for type script is .ts it refer to type script.  It is Superset of javascript, or say as Strong typing in javascript 

2.       Types :  Their are different type of data type to over come the type safe problem of var in javascript. 
Primitive :
number,
string ,
Boolean,
any

Custom 
interface
classes.

Thursday, 27 April 2017

Angularjs Details

What is Angular JS ?

AngularJS is a MVC framework and powerful library  that enhances HTML by attaching directives to html pages with new attributes or tags and expressions in order to define very powerful templates directly.
(Extending HTML) Declare dynamic views in web-applications( SPA)Extend HTML vocabulary for web application.
Angular JS 1.3  - Faster , Easy and Powerful

Why Angular JS?
Magical two way data binding
Structure front end code -MVC (solid and testable code)
Routing support ( State based  and View based) – SPA
Templating done with HTML 5
Enhanced User Experience with  form validation
Teach HTML new  syntax with  directives ( say HTML 6)
Embeddable, testable (Jasmine)  and injectable (DI)
Embeddable à Angular with Require JS / jquery
Powered by Google and active community

Wednesday, 26 April 2017

Single page application in angularjs


Step by step approach for creating a single page application using angularjs.
1.       Lets take the Index.html  as the master page and rest of the pages are child page.
You need to include all the resource file reference to that page only.
For single page application you need to include  angular-route.min.js along with angular.min.js.

In below code snippet we included the bootstrap also to make the application responsive.

Sunday, 15 January 2017

Angularjs rich text editor

Simple steps to use wysiwyg angularjs rich text edit. It is very simple in look and as well simple to implement.  Just follow the step by step way as given below to implement for AngularJs.

 

You can the editor like below. Sample screen Click here



Thursday, 12 January 2017

Develop android apps using visual studio 2015

1.       Need to Install the visual studio 2015 Community Version.
Use below link to install Visual Studio 2015

2.       Open Visual Studio and select  Apache Cordova
Open Visual Studio  à  click on New Project .
Select  Type Script à Apache Cordova App like below.