意思是用alert弹框后..点击确定后刷新了页面?

解决方案 »

  1.   

    同意3楼,大概代码
    bool hasRight = gs.CheckUserPopedom(HttpContext.Current.User.Identity.Name, ModelID, ref v);            if (!hasRight) {
                    Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "error", "$(document).ready(function(){alert('无权访问!');location.href='/NoAccess.aspx';});", true);
                    return;
                }
      

  2.   

    [img=C:\Documents and Settings\user\桌面\未命名.bmp][/img
      

  3.   

     if (ViewState["userRole"].ToString() == "0")
                {
                    Response.Redirect("GiftInfo.aspx?proid=" + e.CommandArgument.ToString() + "");
                    //this.Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "change('zulinGift','companyGift','personGift');changeImg('zuImg','comImg','perImg');", true);
                }
                else if (ViewState["userRole"].ToString() == "1")
                {
                   // this.Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "$(document).ready(function(){alert('无权访问!');});", true);
                    this.Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "window.alert('您无法兑换租赁商家礼品!');change('zulinGift','companyGift','personGift');changeImg('zuImg','comImg','perImg');", true);
                }
                else if (ViewState["userRole"].ToString() == "2")
                {
                    this.Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "window.alert('您无法兑换租赁商家礼品!');change('zulinGift','companyGift','personGift');changeImg('zuImg','comImg','perImg');", true);
                }
                else
                {                this.Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "window.alert('您无法兑换租赁商家礼品!');change('zulinGift','companyGift','personGift');changeImg('zuImg','comImg','perImg');", true);            }  就是这段代码