p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   ASP.NET 3.5 Basics (http://p2p.wrox.com/forumdisplay.php?f=351)
-   -   pop up message problem (http://p2p.wrox.com/showthread.php?t=69487)

badboy1 July 20th, 2008 06:15 AM

pop up message problem
 
hi, why the pop up message does not show when i there got redirect after the pop up code... like that:

  Page.ClientScript.RegisterStartupScript(GetType(St ring), "a", "<script>alert('aaa')</script>")

Response.Redirect("a.aspx")

if remove the redirect then the pop up message work...


planoie July 21st, 2008 09:12 AM

When you use "Response.Redirect", ASP.NET issues a "Status 302: Page Moved" response to the browser. No HTML ever gets to the browser, so the browser only responds to the redirect. In order to do what you describe, you must use an alternate method of redirecting. If you want to show a javascript alert box, then you could similarly use javascript to "redirect" the user (document.location.href = '<new page here>';). Put that after the alert and the page will change after the user clicks OK on the alert. Otherwise, you can use a redirect meta tag for an explicit timed redirect.

-Peter
compiledthoughts.com

badboy1 July 22nd, 2008 07:28 AM

Thank. It Work using javascript redirect. i just curious. how to redirect using meta tag?


planoie July 22nd, 2008 08:54 AM

http://www.google.com/search?q=redirect+meta+tag

-Peter
compiledthoughts.com


All times are GMT -4. The time now is 12:31 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.