jQuery nyroModal 与 ASP.NET 使用 Web 服务

发布于 2024-07-16 08:37:29 字数 509 浏览 5 评论 0原文

我已经使用 jQuery nyroModal 插件有一段时间了,坦率地说,它是我迄今为止使用过的最好的模态插件之一! 我希望很多其他人也使用过这个插件,因此我需要一些关于将它与 ASP.NET 一起使用的帮助。

然而,我过去遇到过一个问题,并试图让它与 ASP.NET 服务器控件一起工作 - 基本上,人们不能在模式中使用任何服务器控件,因为它创建了另一个表单标记,正如您显然知道的那样,ASP. NET 只允许一个表单标签。 因此,我决定改用标准 HTML 控件,并使用 Web 服务/页面方法调用服务器端代码(例如单击按钮)。 这很好,但我不明白的是如何在模态中进行正确的回调,换句话说 - 单击按钮,模态缩小到默认大小并显示加载指示器,然后在 HTML 响应时放大已收到,并希望显示请求的状态(即成功失败

我刚刚开始学习 .NET 中的 Web 服务和回调,所以我绝不是专家。 请有人能解释一下这一点并为我提供一个小的“hello world”示例吗? 我将永远感激不已!

感谢你!

I have been using the jQuery nyroModal plugin for a little bit of time, and frankly its one of the best modal plugins I've used to date! I'm hoping that a lot of other people have also used this plugin, hence me requiring some help with regards to using it along with ASP.NET.

I have however run into a problem with it in the past and trying to get it working with ASP.NET server controls - basically one cannot use any server controls within the modal as it creates another form tag, and as you obviously know, ASP.NET only allows ONE form tag. So I have decided to use standard HTML controls instead and call server-side code (say on button click) using web-services/page-methods. This is fine, but what I don't understand is how to do a proper callback in the modal, in other words - click the button, the modal shrinks to its default size and shows the loading indicator, and then enlarges when the HTML response has been received, and hopefully show the status of the request (ie. successful or failed)

I have just started learning about web-services and callbacks in .NET, so Im by no means an expert. Please could someone shed some light on this and provide me with a small "hello world" example? I will be be forever greatful!

thank u!

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

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

发布评论

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

评论(1

来日方长 2024-07-23 08:37:29

我也遇到过这个问题,事实证明,当您打开模式时,它会向下移动到

标记之外的 HTML 末尾!

如果您使用的是最新版本的 nyroModal,您可以通过 blocker 属性告诉它哪个元素出现在内部

 $('#myElement').nyroModal({
    'blocker': '#aspnetForm'
  });

更多信息:http://nyromodal.nyrodev.com/#demos

I've had this problem as well and as it turns out when you open the modal it moves down to the end of your HTML outside of the <form> tag!

If you're using the latest version of nyroModal you can just tell it what element to appear inside with the blocker property

 $('#myElement').nyroModal({
    'blocker': '#aspnetForm'
  });

More info here: http://nyromodal.nyrodev.com/#demos

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