How to get alert message before redirect a page

前端 未结 7 1245
面向向阳花
面向向阳花 2020-12-25 07:49

I\'m using vs 2010. I need to display the message to user and redirect the page.

I use the below line.

ScriptManager.RegisterStartupScript(this, this         


        
7条回答
  •  清酒与你
    2020-12-25 08:42

    If you are Working with UpdatePanel then You have to use this : It is work with Update Panel.

     var message = new System.Web.Script.Serialization.JavaScriptSerializer().Serialize("Bill No. : " + BillNo + " successfully generated.");
                var script = string.Format("alert({0});window.location ='ChhallanPrint.aspx';", message);
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "", script, true);
    

提交回复
热议问题