2010-10-21 73 views
0

我有按钮点击处理程序事件,其中我使用if-else condition.How如果它运行到其他语句,我可以显示一条消息? 喜欢请填写要求!!在asp.net服务器端的消息框

+0

你必须填写的要求..不是我们:) – Shoban 2010-10-21 09:36:45

+1

消息框*在服务器端*? – 2010-10-21 09:43:44

回答

2

你可以使用RegisterStartupScript方法:

ClientScript.RegisterStartupScript(GetType(), "someKey", "alert('oops');", true); 

但对于这样的事情可能是更好地使用验证控件(不能肯定地说,你还没有指定任何背景,也没有解释的逻辑)。

0

可以使用javascript中的.cs

Page.ClientScriptBlock.RegisterStartupScript(Page. GetType(), "Key", "alert('message');", true);