Skip to content

No error when calling a post api in .net 7.20 #56672

@gabrielacos

Description

@gabrielacos

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

        public async Task<IActionResult>  TemplateDetail([FromBody] Dictionary<string, object> rowData)
        {
        if (rowData == null)
        {
            return BadRequest("No data received");
        }
        TempData["RowData"] = rowdata';
      
        return Ok(new {data = rowData});
        } 

When i call this controller from an ajax, everything seems to be working but, when I receive the response on the front ent it says error 500.

The error also does not appear when i wrap the function in a try catch. I'm not sure if this is a bug for the C# dev kit or here.

Expected Behavior

The expected behavior should be success without any error.

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

7.0.20

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templates

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions