Monday, 30 March 2015

Getting json response as object

 [WebMethod]
    [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
    public static IEnumerable<SearchInfluencers.InfCategories> GetICategories()
    {
        return DAFindInflueners.GetInfluencersCountByCategory().OrderBy(i => i.ICATEGORYNAME).ToList();
    }


//---In js file
 success: function (Catlist) {
            $.each(Catlist.d, function (index, Cat) {
                alert(Cat.ICATEGORYID + Cat.ICATEGORYNAME + Cat.ICATINFCOUNT')
            });  

No comments:

Post a Comment

Extracting Nupkg files using command line

Rename it to zip first then extract files as below 1.     Rename-Item -Path A_Package.nupkg -NewName A_Package.zip 2.     Make sure to repla...