如何使用asp.net在同一网页上获取消息框 [英] How to get message box in the same webpage using asp.net
本文介绍了如何使用asp.net在同一网页上获取消息框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用asp.net代码在同一网页中而不是另一网页中显示消息框,请帮帮我.
谢谢.
hi ,
I want to display the message box in the same web page not in the another page using asp.net code plzzzzzzzzz help me.
Thank you.
推荐答案
您必须使用Windows确认/警告消息框.
在所需的控件上的事件上附加客户端处理程序.
* .cs文件中的Ex 1:
You have to use Windows confirm/alert messagebox for the same.
Attach a client side handler on the event on the control where you want it.
Ex 1 in *.cs file:
btnDelete.Attribute.Add("onclick","javascript:alert('You just pressed Delete!');");
* .aspx文件中的示例2:
Ex 2 in *.aspx file:
<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="alert('You pressed a button!')" />
这篇关于如何使用asp.net在同一网页上获取消息框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文