您当前的位置: 首页 >  .net

asp.net(c#)的警告操作类

发布时间:2008-11-09 14:53:00 ,浏览量:0

由于在写后台程序的时候经常涉及到要写js 弹出警告对话框,在网络上找到这样的一个类:

/############################################ 版权声明: 文章内容为本站编辑,创作.你可以任意转载、发布、使用但请务必以明文标注文章原始出处及本声明 http://www.opent.cn  作者:浪淘沙 ############################################/

using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Text;

namespace EC {     ///     /// 信息输出通用方法     ///     public class MessageObject     {                      ///         /// 一般输出         ///         ///         public static void Write(string str)         {             System.Web.HttpContext.Current.Response.Write(str);         }                ///         /// 显示一段自定义的输出代码         ///         ///         ///         public static void ShowJS(System.Web.UI.Page MyPage, string strCode)         {             StringBuilder sb = new StringBuilder();             sb.Append("");             MyPage.Response.Write(sb.ToString());                  }               ///         /// 页面重载         ///         public static void Location()         {             StringBuilder sb = new StringBuilder();             sb.Append("");             System.Web.HttpContext.Current.Response.Write(sb.ToString());

        }               ///         /// 显示一个弹出窗口         ///         ///         public static void Show(string str)         {             StringBuilder sb = new StringBuilder();             sb.Append("");

            System.Web.HttpContext.Current.Response.Write(sb.ToString());         }                ///         /// 显示一个弹出窗口,并关闭当前页         ///         ///         public static void ShowClose(string str)         {             System.Text.StringBuilder sb = new System.Text.StringBuilder();             sb.Append("/n");             System.Web.HttpContext.Current.Response.Write(sb.ToString());         }               ///         /// 显示一个弹出窗口,并转向当前页(刷新)         ///         ///         public static void ShowLocation(string str)         {             StringBuilder sb = new StringBuilder();             sb.Append("");

            System.Web.HttpContext.Current.Response.Write(sb.ToString());         }                ///         /// 显示一个弹出窗口,并转向目标页(导航)         ///         ///         ///         public static void ShowRedirect(string str, string url)         {             StringBuilder sb = new StringBuilder();             sb.Append("");

            System.Web.HttpContext.Current.Response.Write(sb.ToString());         }               ///         /// 显示一个弹出窗口,并转向上一页         ///         ///         public static void ShowPre(string str)         {             StringBuilder sb = new StringBuilder();             sb.Append("");

            System.Web.HttpContext.Current.Response.Write(sb.ToString());         }                ///         /// 重定向         ///         ///         public static void RedirectPage(string url)         {             string path = "http://" + System.Web.HttpContext.Current.Request.Url.Host + url;             StringBuilder sb = new StringBuilder();             sb.Append("");

            System.Web.HttpContext.Current.Response.Write(sb.ToString());         }

           } }

关注
打赏
1688896170
查看更多评论

暂无认证

  • 0浏览

    0关注

    105956博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录

0.4202s