我们平时在开发过程中,需要在后台代码中控制对话框的弹出
比如说,数据保存成功后要提示用户保存成功.
我们一般的做法是
Response.Write("<script>alert('Save successfully.')</script>");

但是如果页面套在MasterPage的一个iframe的话,在后台代码调用上面的语句,
页面的样式就变了.我们可以通过下面的办法来解决
 1Alert Message in Code Behind Fileusing System;
 2Alert Message in Code Behind Fileusing System.Data;
 3Alert Message in Code Behind Fileusing System.Configuration;
 4Alert Message in Code Behind Fileusing System.Web;
 5Alert Message in Code Behind Fileusing System.Web.Security;
 6Alert Message in Code Behind Fileusing System.Web.UI;
 7Alert Message in Code Behind Fileusing System.Web.UI.WebControls;
 8Alert Message in Code Behind Fileusing System.Web.UI.WebControls.WebParts;
 9Alert Message in Code Behind Fileusing System.Web.UI.HtmlControls;
10Alert Message in Code Behind Fileusing System.Text;
11Alert Message in Code Behind File
12

我们在调用的时候只要新建一个Alert的实例,然后调用ShowMessage方法就可以
Alert alert = new Alert();
alert.Show("Save successfully.");

 

相关文章:

  • 2021-09-05
  • 2022-12-23
  • 2021-12-03
  • 2021-06-17
  • 2022-12-23
  • 2022-12-23
  • 2021-07-20
  • 2021-11-23
猜你喜欢
  • 2021-08-18
  • 2022-12-23
  • 2021-10-18
  • 2022-12-23
  • 2021-10-01
  • 2021-12-03
  • 2021-05-04
相关资源
相似解决方案