HotelCommon/Jscript.cs

(开头部分) 6KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Web.UI;

namespace HotelCommon
{
    public class Jscript
    {
        /// 弹出JavaScript小窗口
        /// </summary>
        /// <param name="js">窗口信息</param>
        public static void Alert(string message)
        {
            #region
            string js = @"<Script language='JavaScript'>
                    alert('" + message + "');window.location</Script>";
            HttpContext.Current.Response.Write(js);
            #endregion
        }
//        public static void Alert(string str_Ctl_Name, string str_Message)
//        {
////			page.RegisterStartupScript("","<script>alert('"+str_Message+"');document.forms(0)."+str_Ctl_Name+".focus(); document.forms(0)."+str_Ctl_Name+".select();window.location.href=window.location.href</script>");
//            HttpContext.Current.Response.Write(@"<script>alert('" + str_Message + "');document.forms(0)." + str_Ctl_Name + ".focus(); document.forms(0)." + str_Ctl_Name + ".select();history.go(-1);</script>");
//            //page.RegisterStartupScript("", @"<script>alert('" + str_Message + "');document.forms(0)." + str_Ctl_Name + ".focus(); document.forms(0)." + str_Ctl_Name + ".select();history.go(-1);</script>");
//        }

        /// <summary>
        /// 弹出消息框并且转向到新的URL
        /// </summary>
        /// <param name="message">消息内容</param>
        /// <param name="toURL">连接地址</param>
        public static void AlertAndRedirect(string message, string toURL)
        {
            #region
            string js = "<script language=javascript>alert('{0}');window.location.replace('{1}')</script>";
            HttpContext.Current.Response.Write(string.Format(js, message, toURL));
            #endregion
        }

        /// <summary>
        /// 回到历史页面
        /// </summary>
        /// <param name="value">-1/1</param>
        /// 
        public static void GoHistory(string msg, int value)
        {
            #region
            string js = @"<Script language='JavaScript'>
                    alert('{0}');history.go({1});  
                  </Script>";
            HttpContext.Current.Response.Write(string.Format(js, msg, value));
            #endregion
        }
//        public static void GoHistory(int value)
//        {
//            #region
//            string js = @"<Script language='JavaScript'>
//                    history.go({0});  
后面还有 115 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。