Saturday, 20 January 2018

cordova "no java files found that extend cordovaactivity"

Getting Error as:

Severity Code Description Project File Line Suppression State Error No Java files found which extend CordovaActivity. OilFreeRecipes 1

This issue is causing due to missing of MainActivity.Java File Generally it is residing on the below path.
[Application Name]\platforms\android\src\com
Here it should have the folder name based on the namespace you have given. Suppose I have given namespace as com.passion.oilfreerecipes So there should have folder passion --> OilfreeRecipes

Read Array object in Javascript Based on Query String

Please check the previous article  Click here to see how we can read the value which we pass in query string
Now Framing the javascript array  Object,


var val = [
        { Id: 1, Image: 'Content/Images/2.jpg', Value:'This is 1 content' },
        { Id: 2, Image: 'Content/Images/2.jpg', Value:'This is 2 content' }
    ];

Code to read array of object is javascript

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

Others

You will like to read it