当我点击新的交易按钮时,它只显示弹出对话框而不显示详细信息.我完全按照教程操作,但我的弹出对话框仍然没有弹出对话框中的详细信息.Output.

Site.js

showInPopup = (url, title) => {
    $.ajax({
        type:"GET",
        url: url,
        success: function (res) {
            $("#form-modal.modal-body").html(res);
            $("#form-modal.modal-title").html(title);
            $("#form-modal").modal('show');
        }
    })

}

推荐答案

我发现您缺少JQuery括号form-modal .modal-body中的"空间".空格表示您正在 Select div的一个子项.

    showInPopup = (url, title) => {
        $.ajax({
            type: 'GET',
            url: url,
            success: function (res) {
                $('#form-modal .modal-body').html(res);
                $('#form-modal .modal-title').html(title);
                $('#form-modal').modal('show');
            }
        })
    }

-----------------------------old post----------------------
The ajax is success, or no window will popup. The problem is on the response. Make sure you could see this page by visit /Transaction/AddOrEdit directly.Then the popup details will show. enter image description here enter image description here

如果url有效,你可以试着把按钮改为onclick="showInPopup('/Transaction/AddOrEdit','New Transaction')",看看它是否有效.

Csharp相关问答推荐

List T.AddRange在传递ConcurrentDictionary作为参数时引发ArgumentExcellent

当Visual Studio处于升级管理模式时,无法安装Torch运行时

如何在Visual Studio中为C# spread操作符设置格式规则?

ASP.NET Core:如何在IPageFilter中注入ApplicationDbContext

. NET在上一个操作完成之前,在此上下文实例上启动了第二个操作

C#中使用BouncyCastle计算CMac

为什么SignalR在每个Blazor服务器应用程序启动时最多启动8个服务器?

Quartz调度程序不调用作业(job)类

TagHelpers在新区域不起作用

泛型参数在.NET 8 AOT中没有匹配的批注

在C#.NET项目中启动时,如何等待提升的PowerShell进程退出?

在ASP.NET Core 8 MVC中本地化共享视图

为什么ReadOnlySpan;T&>没有Slice(...)的重载接受Range实例的?

我找不到ASP.NET Web应用程序(.NET框架).已 Select .NET框架项目和项模板以及此组件(&Q;)

C#System.Commandline:如何向命令添加参数以便向其传递值?

避免在特定区域中设置Visual Studio代码的自动格式

如何将行添加到DataGrid以立即显示它?

S,在.NET核心控制台应用程序中,AddScope和AddSingleton有什么不同?

如何处理ASP.NET Core中包含两个构造函数的控制器?

如何模拟一个返回OneOf IServiceA,IServiceB的方法?使用Moq