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.