弹出消息和response.redirect查询

时间:2015-07-13 15:14:03

标签: c# asp.net

这个怎么样?好像它不是在阅读其他部分吗?

protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["IslandGasAdminPM"] != null)
        {
            if (!Page.IsPostBack)
            {
                bindgrid();
                Label1.Text = "- Purchasing Manager";

            }
            else
            {
                Response.Write("<script>alert('Purchasing Manager credentials needed'); window.location.href='/LogIn.aspx';</script>");
            }
        }
    }

1 个答案:

答案 0 :(得分:0)

尝试:

protected void Page_Load(object sender, EventArgs e)
{
    if (Session["IslandGasAdminPM"] != null)
    {
        Label1.Text = "- Purchasing Manager";
    }
    else
    {
        Response.Write("<script>alert('Purchasing Manager credentials needed'); window.location.href='/LogIn.aspx';</script>");
    }
}