App_Code/Components/Jscript.cs

(开头部分) 5KB

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

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;

/// <summary>
/// Jscript 的摘要说明
/// </summary>
public class Jscript
{
    // Methods
    public static void JsAlert(Page page, string msg)
    {
        page.ClientScript.RegisterStartupScript(page.GetType(), "zhxt", string.Format("alert('{0}!')", msg), true);
    }

    public static void  AlertAndLocationHref(Page page, string msg, string url)
    {
        page.ClientScript.RegisterStartupScript(page.GetType(), "zhxt", string.Format("alert('{0}!');location.href='{1}';", msg, url), true);
    }

    public static void  EndRunJs(Page page, string js)
    {
        page.ClientScript.RegisterClientScriptBlock(page.GetType(), "zhxt", string.Format("{0}", js), true);
    }

    public static void  Redirect(Page page, string toURL)
    {
        page.ClientScript.RegisterStartupScript(page.GetType(), "zhxt", string.Format("window.location.replace('{0}');", toURL), true);
    }

    public static void  RunJs(Page page, string js)
    {
        page.ClientScript.RegisterStartupScript(page.GetType(), "zhxt", string.Format("{0}", js), true);
    }

    public static void  ShowModalDialogWindow(Page page, string webFormUrl, int width, int height)
    {
        string CommandStr = "window.showModalDialog('{0}','tempdialog','dialogWidth:{1}px;dialogHeight:{2}px;center:yes;help=no;resizable:no;status:no;scroll=no')";
        CommandStr = string.Format(CommandStr, webFormUrl, width, height);
        page.ClientScript.RegisterStartupScript(page.GetType(), "zhxt", CommandStr, true);
    }

    public static void Alert(string message)
    {
        string js = "<Script language='JavaScript'>\r\n                    alert('" + message + "');</Script>";
        HttpContext.Current.Response.Write(js);
    }

    public static void AlertAndGoBack(string message)
    {
        string js = "<Script language='JavaScript'>\r\n                    alert('" + message + "');history.go(-1);</Script>";
        HttpContext.Current.Response.Write(js);
    }

后面还有 89 行代码,解锁后查看完整代码

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

AI 解读

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

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