小编fcm*_*ine的帖子

HttpClient PutAsync不向api发送参数

在控制器上Put如下:

[HttpPut]
[ActionName("putname")]
public JsonResult putname(string name)
{
    var response = ...
    return Json(response);  
}
Run Code Online (Sandbox Code Playgroud)

问题在于通过以下方式消费此API

using (httpClient = new HttpClient())
{
    string name = "abc";
    string jsonString = JsonConvert.SerializeObject(name);
    var requestUrl = new Uri("http:...../controller/putname/");
    using (HttpContent httpContent = new StringContent(jsonString))
    {
        httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");
        HttpResponseMessage response = httpClient.PutAsync(requestUrl, httpContent).Result;
    }
Run Code Online (Sandbox Code Playgroud)

此代码不会将参数名称传递给控制器​​.我甚至尝试将uri更改为/ putname /"+ name.

c# json.net asp.net-mvc-3

8
推荐指数
1
解决办法
3万
查看次数

jqGrid在分组时对列进行排序,考虑分组标题

我有jqgrid.我根据列值对几行进行了分组.在 定义jqGrid的代码的链接部分提供了工作演示

    var preclosingtable = $('#preclosing');
    preclosingtable.jqGrid({
        datatype: 'local',
        data: data.DOCS,
        colNames: ['', 'Documents Received', 'Comments', 'NA', 'DocGroup'],
        colModel: [
        { name: 'Documents', index: 'Documents', align: 'left', sortable: false, editable: false, width: 20 },
        { name: 'DocsReceived', index: 'DocsReceived', align: 'center', sortable: false, editable: true, edittype: 'checkbox', editoptions: { value: "True:False" }, formatter: "checkbox", width: 140 },
        { name: 'Comments', index: 'Comments', align: 'center', sortable: false, editable: true, edittype: "textarea", editoptions: { rows: "3", cols: "16" }, width: …
Run Code Online (Sandbox Code Playgroud)

jquery jqgrid jqgrid-asp.net

5
推荐指数
1
解决办法
6646
查看次数

标签 统计

asp.net-mvc-3 ×1

c# ×1

jqgrid ×1

jqgrid-asp.net ×1

jquery ×1

json.net ×1