将Class属性绑定到JSON

时间:2017-12-11 09:54:54

标签: c# json model-view-controller

如何在MVC中将所有类属性组合成单个JSON结果我有以下类属性。

{
    "Student":[
    {
        "Studentdetails":[{
            "id": "01",
            "name": "abcd",
            "age": "20"         
        }],
        "parents":[{  
            "name":"mothername"
        }],
        "attendance":[{
            "attendance":"70%"
        }]

    }],
    "academic":[{  
        "acc":"2017"
    }]
}

我想将所有属性组合到JSON,如下面的结果

    .searchButton {
    background: #fff url(http://pixsector.com/cache/e7836840/ave6d43d85eb121839a10.png) no-repeat;
    background-size: contain;
    width: 4%;
    height: 21px;
}



 <div id="search">
<input type="text" class="searchTerm" placeholder="What are you looking for?">
 <button type="submit" class="searchButton">
   <span class="icon"></span> 
   </button>
   </div>

如何在MVC应用程序中获得上述响应? 提前致谢。

0 个答案:

没有答案
相关问题