How to get alert message before redirect a page

前端 未结 7 1257
面向向阳花
面向向阳花 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:40

    If you want to put in .CS file, just try this:

    var page = HttpContext.Current.CurrentHandler as Page;
               ScriptManager.RegisterStartupScript(page, page.GetType(), "alert", "alert('" + msg +"');window.location ='"+ aspx +"';", true);
    

提交回复
热议问题