How to get alert message before redirect a page

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

    The best way, if possible, is to put the code into the OnClientClick.

    
    

    The problem with putting it into a startupscript is that the startupscript is run on postback, not real time. The redirect will happen before the postback. (possibly)

    The other solution of course is to put the redirect into the startupscript code.

    The page will post back, the script will run and then it will redirect.

提交回复
热议问题