C# ASP.NET Ajax Communication Returns Large HTML

Asked 2 years ago, Updated 2 years ago, 103 views

I'm a beginner at MVC.
The workspace is local.

$.ajax({
        type: "POST",
        url: "/aaa/bbb",
        data: {selectService:sendId},
        success:function(msg){
            alert(msg);

...

 [HttpPost]
public string bbb(string selectService)
{
    varmsg="aaa";
    return msg;
}

It's a method that usually works.
Maybe I've done something, but suddenly I get a HTML source that doesn't matter, not any string.

Until then, I had put a breakpoint on the controller side to check the contents, but it didn't get stuck either.
The ajax communication itself seems to be successful.(Alerts work)
The error side is unresponsive.

What can you think of?

javascript c# html ajax mvc

2022-09-30 21:16

1 Answers

Perhaps ASP.NET is experiencing some kind of error, and the redirect is showing the error page, login page, etc.

First, check the returned HTML and server side error logs.If you are debugging with IIS Express, you can also check for exceptions in Visual Studio.Also, even on IIS, if you configure it in Web.config, the exception log will appear on the error page.


2022-09-30 21:16

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.