用jQuery打开一个模态窗口,内容由服务器提供

发布于 2024-12-22 18:29:18 字数 288 浏览 1 评论 0原文

我正在创建一个 ASP.Net MVC 网站。我必须在一些模式窗口中显示一些文本。我发现了几个 jQuery 插件可以制作模式窗口,但内容是在客户端生成的。

我需要调用服务器,例如,当我必须显示模态窗口时,到达服务器并将页面 XYZ 作为模态窗口的内容加载。

如果我可以自定义模态窗口(目标是有可能拥有非矩形模态窗口。

我搜索了一些此类插件,但目前我只找到了带有 javascript 内容的模态窗口。

你知道一个插件可以做到这一点吗?另外

,jquery 的插件子域似乎已关闭:(

I'm creating an ASP.Net MVC website. I've to display some text in some modal windows. I found several plugins of jQuery which makes a modal windows, but the content is generated on the client.

I need to call the server, e.g. when I've to display my modal windows, got to the server and load the page X-Y-Z as content of the modal windows.

If I can customize the modal windows(The goal is to have the possibility to have non-rectangle modal windows.

I searched some plugins of this kind, but for now I found only modal windows with javascript content.

Do you know one pluging which does this?

In addition, it seems that the plugin subdomain of jquery is down :(

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

最美不过初阳 2024-12-29 18:29:18

看看 jQuery load

像这样的东西会给你想要的:

HTML

<a href="your-page" id="ModalDialogOpenLink">open</a>
<div id="ModalDialogDiv"></div>

jQuery

$('#ModalDialogOpenLink').click(function () {
    $('#ModalDialogDiv').load(this.href, function () {
        $(this).dialog();
    });
    return false;
});

编辑 我也添加了 html 标记。

Have a look at jQuery load.

Something like this will give you want you want:

HTML

<a href="your-page" id="ModalDialogOpenLink">open</a>
<div id="ModalDialogDiv"></div>

jQuery

$('#ModalDialogOpenLink').click(function () {
    $('#ModalDialogDiv').load(this.href, function () {
        $(this).dialog();
    });
    return false;
});

Edit I've added the html markup as well.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文