如何获得警报消息之前重定向页面 [英] How to get alert message before redirect a page

查看:103
本文介绍了如何获得警报消息之前重定向页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是2010年VS我需要显示的消息,用户和重定向的页​​面。

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

我用下面的一行。

ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "<script> alert('User details saved sucessfully');window.open('frmDisplayUsers.aspx');</script>", true);

但我没有得到警报消息和页面直接重定向。

But I didn't get the alert message and the page was directly redirected.

如何获得警报消息?

推荐答案

您code是打开的窗口,但你要求一个重定向,下面是一个重定向的例子:

Your code is opening window but you asking for a redirect, below is an example of a redirect:

ScriptManager.RegisterStartupScript(this, this.GetType(), 
"alert", 
"alert('User details saved sucessfully');window.location ='frmDisplayUsers.aspx';", 
true);

这篇关于如何获得警报消息之前重定向页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆