当前位置:编程学习 > C#/ASP.NET >>

关于弹出框白屏的问题

我用这种方式弹出提示框 
this.Response.Write("<script>alert('不能删除');</script>");
但是它有一个问题就是当弹出时后面白屏,请问怎么解决啊。 --------------------编程问答-------------------- 整个页面全提交到服务器了 --------------------编程问答-------------------- 有没有好的办法啊。 --------------------编程问答-------------------- Page.ClientScript.RegisterStartupScript(this.GetType(),"js","<script>alert('不能删除');</script>"); --------------------编程问答--------------------



this.Response.Write("<script defer>alert('不能删除');</script>");


加个defer参数试试




--------------------编程问答-------------------- mark --------------------编程问答-------------------- 因为你提交了当前页才弹出的提示 
返回下试试
this.Response.Write("<script>alert('不能删除');window.history.go(-1);</script>"); --------------------编程问答-------------------- 可以满足你的2个方法
/// <summary>
    /// 弹出提示框


    /// </summary>
    /// <param name="pg"></param>
    /// <param name="str"></param>
    public static void Alert(Page pg, string str)
    {
        Type tye = pg.GetType();

        ClientScriptManager csm = pg.ClientScript;

        if (!csm.IsStartupScriptRegistered("alert"))
        {
            csm.RegisterStartupScript(tye, "alert", "<script>alert('" + str + "')</script>");
        }
    }

    /// <summary>
    /// UpdatePanel弹出提示框

    /// </summary>
    /// <param name="contorl"></param>
    /// <param name="alert"></param>
    public static void UPAlert(Control contorl, string str)
    {
        Type type = contorl.GetType();
        ScriptManager.RegisterStartupScript(contorl, type, "Alert", "alert('" + str + "');", true);
    } --------------------编程问答-------------------- ScriptManager.RegisterStartupScript(tye, "alert", "<script>alert('" + str + "')</script>"); --------------------编程问答-------------------- up
godgreat(★★★★★)接触计算机才知道什么叫学海无涯!(★★★) ( ) 信誉:97 --------------------编程问答-------------------- pg.ClientScript 有时候也不稳定,还是有白屏的。不知道什么缘故??
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,