ASP.NET Web应用程序的消息框 [英] ASP.NET Web Application Message Box

查看:171
本文介绍了ASP.NET Web应用程序的消息框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一个asp.net Windows窗体应用程序,在C#code后面你可以使用:

In an asp.net windows forms application, in the C# code behind you can use:

MessageBox.Show("Here is my message");

有一个asp.net web应用程序的相同呢?
我可以调用的东西从C#code的后面,将显示一个消息框,用户?

Is there any equivalent in a asp.net web application? Can I call something from the C# code behind that will display a message box to the user?

这个用法示例:我有一个在code加载的文件后面的按钮。当文件被加载,或者如果有一个错误,我想弹出一个消息给用户说明的结果。

Example usage of this: I have a button that loads a file in the code behind. When the file is loaded or if there is an error I would like to popup a message to the user stating the result.

在这个任何想法?

推荐答案

您想要使用的警报。遗憾的是它并不像你一样与Windows窗体。

You want to use an Alert. Unfortunately it's not as nice as with windows forms.

ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable + "');", true);

这个问题在这里类似: http://forums.asp.net/t/1461308.aspx/1

这篇关于ASP.NET Web应用程序的消息框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆