显示隐藏表单,或打开模式对话框
在 HTML 页面中显示简单表单(其中包含调用 Web 方法的保存按钮)的最佳方法是什么?我正在考虑以下选项之一:
- 切换隐藏的
,其中包含与所示 .aspx 具有相同行为的表单
- 显示 模态对话框,使用 JavaScript 加载单独的 .aspx 来显示表单。
哪个更好,在什么情况下更好?
What is the best method to show a simple form in a HTML page, which includes a save button that calls a web method? I'm considering one of these options:
- Toggle a hidden
<div>
which includes a form with the same behaviour of the shown .aspx - Display a modal dialog using JavaScript that loads a separate .aspx to show the form.
Which is better, and under which circumstances?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果弹出内容相对较小,那么最好将其包含在主页的隐藏 div 中。当您想要显示它时,这将为您提供即时性能。不这样做的原因是:
If the popup content is relatively small, then it will be best to just include it right in your main page in a hidden div. This will give you instant performance when you want to display it. The reasons not to do it this way are: