如何构建 C# asp.net ajax 向导(或者更确切地说转换基于 PlaceHolder 的向导)

发布于 2024-08-21 01:06:42 字数 435 浏览 8 评论 0原文

我看过类似的问题,似乎无法得到我需要的答案。

我们有一个基于 Webform 的 ASP.NET 应用程序,具有基于向导的界面。这些步骤在 2 到 5 个步骤之间变化,其中每个步骤可能依赖于前一个步骤,即在用户看到它之前填充。向导基于隐藏和显示每个步骤的 PlaceHolder 控件。这很有效,因为可以在回发时设置可见属性,验证器相应地工作并且可以完全控制步骤。

通过使用 UpdatePanel 包装页面来将其转换为“ajax”样式向导似乎不起作用,因为最初不呈现不可见部分,从而在隐藏和显示占位符时导致各种 javascript/jQuery 问题。我怀疑我构建事物的方式可能不正确,因此很难提出正确的问题。

你们会如何转换这个向导类型接口,而不是试图解决这个混乱问题。我只使用过 MS ajax libaray 的 UpdatePanel 部分,并且对 jQuery 有点熟悉。

谢谢

I have looked at similar questions and cant seem to get the answer I need.

We have a Webform based asp.net application with Wizard based interfaces. These vary between 2 to 5 steps where each step may be reliant on the previous one, ie populated before the user sees it. The Wizards are based on hiding and showing PlaceHolder controls for each step. This works well as the visible property can be set on postback, the validators work accordingly and there is full control over the steps.

Converting this to an "ajax" style wizard by wrapping the page with an UpdatePanel doesnt seem to work since the non-visible parts are not rendered initially causing all sorts of javascript/jQuery issues when hiding and showing PlaceHolders. I suspect I may be incorrect in the way I am constructing things making it difficult to ask the right questions.

Rather than trying to fix this mess, How would you guys go about converting this Wizard type interface. I have only used the UpdatePanel part of the MS ajax libaray and am somewhat familiar with jQuery.

Thanks

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

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

发布评论

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

评论(1

一身骄傲 2024-08-28 01:06:43

也许您的问题将解决为 asp:updatePanel ChildrenAsTriggers=true 添加属性值。

如果没有,并且弹出错误,仍然尝试更改对 display: none 不可见的控件样式
当你这样设置时,它们存在但不可见。

最后的建议是链接中的本教程:
http://mattberseth.com/blog/2007/06/quick_ajax_tip_provide_a_bette.html

Maybe your problem will solved adding property value for asp:updatePanel ChildrenAsTriggers=true.

If not, and errors pop up still try changing style of controls that have to be invisible to display: none
When you set it like that they exists but they aren't visible.

And the last suggestion is this tutorial from link:
http://mattberseth.com/blog/2007/06/quick_ajax_tip_provide_a_bette.html

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