Response.Redirect的后JavaScript的alert() [英] Javascript alert() after Response.Redirect

查看:220
本文介绍了Response.Redirect的后JavaScript的alert()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我后面的代码调用此:

I am calling this in my code behind:

(test.aspx)
Response.Redirect("~/Default.aspx");



我想包括后/ JavaScript警告被重定向到Default.aspx的面前,这可能吗?
我这样做是因为我传递一个值到另一个页面(Test.aspx文件)和页面检查分贝,如果读者HasRow(),然后重定向到Default.aspx的。

I want to include a javascript alert after/before being redirected to Default.aspx, is it possible? I'm doing this because I'm passing a value to another page (test.aspx) and that page checks the db, if reader HasRow(), then redirect to Default.aspx.

推荐答案

做到这一点的方法是显示使用javascript警报,然后做的JavaScript重定向,以及:

The way to do that is display the alert with javascript and then do the redirect with javascript as well:

ScriptManager.RegisterStartupScript(this,this.GetType(),"Redit","alert('asdf'); window.location='" + Request.ApplicationPath + "Default.aspx';",true);

这篇关于Response.Redirect的后JavaScript的alert()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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