弹出带有滚动条的确认窗口
我有一个按钮,我需要在其中弹出确认窗口。
这就像用户单击“是”或“否”的协议。
白色面板中有数据,下面有两个按钮。
数据很大,所以我需要在数据所在的面板中使用滚动条。
这在 winform 应用程序中很容易做到,但现在我正在使用 web 应用程序。 我通常使用 javascript 或 Ajax 显示弹出窗口确认。
这是 AJAX 中的代码:
<p style="background-color: #D0D8E8; text-align: right; padding-right: 20px;">
<asp:Button class="buttonStyle" ID="Update1" runat="server" Text="Update"
onclick="Update1_Click" CausesValidation="true" />
<cc1:ConfirmButtonExtender ID="Update1_ConfirmButtonExtender" runat="server"
ConfirmText="Are you sure you want to make changes in config file? Please restart 'Copiun Backup Server' service for changes to take effect."
Enabled="True" TargetControlID="Update1">
</cc1:ConfirmButtonExtender>
</p>
这就是我在 javascript 中所做的:
<script type="text/javascript">
function OnConfirm() {
if (confirm("Are you sure you want to reset?")) {
return true;
} else {
return false;
}
}
请帮忙..谢谢
i have a button where i need the a confirm popup.
this is like an agreement for the user to click Yes or NO.
there is data in the white panel and two buttons below.
the data is huge so i will be requiring scroll bars in the panel where the data is.
this was very easy to do in winform applications but now i am working with webapplications.
i normally show the popup confirm using javascript or Ajax..
here is that code in AJAX:
<p style="background-color: #D0D8E8; text-align: right; padding-right: 20px;">
<asp:Button class="buttonStyle" ID="Update1" runat="server" Text="Update"
onclick="Update1_Click" CausesValidation="true" />
<cc1:ConfirmButtonExtender ID="Update1_ConfirmButtonExtender" runat="server"
ConfirmText="Are you sure you want to make changes in config file?
Please restart 'Copiun Backup Server' service for changes to take effect."
Enabled="True" TargetControlID="Update1">
</cc1:ConfirmButtonExtender>
</p>
this is what i do in javascript:
<script type="text/javascript">
function OnConfirm() {
if (confirm("Are you sure you want to reset?")) {
return true;
} else {
return false;
}
}
Please help.. thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您最好创建自己的确认对话框。使用标准确认对话框对于大量数据来说看起来非常难看,并且对于滚动条来说更难看。您可以使用 AJAX Toolkit 附带的模态弹出对话框,也可以使用 jQuery UI 对话框之类的东西。
以下是 jQuery UI 对话框的链接:
http://jqueryui.com/demos/dialog/
You would be better off creating your own confirm dialog. Using the standard confirm dialog will look really ugly with a lot of data, and even uglier with scrollbars. You can use the modal poup dialog that comes with the AJAX Toolkit, or you could use something like the jQuery UI dialog.
Here is a link to the jQuery UI dialog:
http://jqueryui.com/demos/dialog/
从此处:
设置焦点可能会将其滚动到视图中(未测试),添加在 if 之前将其添加到您的 js:
该页面上还有其他很酷的内容:
“这会将光标发送到不完整的字段并将该字段变成粉红色。”
From here:
Setting the focus might scroll it into view(not tested), add this to your js before the if:
Something else cool on that page:
"This sends the cursor to the field that was not complete and turns the field pink."