Wrox Programmer Forums
|
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 20th, 2008, 06:15 AM
Authorized User
 
Join Date: Jun 2008
Posts: 17
Thanks: 1
Thanked 0 Times in 0 Posts
Default 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...

 
Old July 21st, 2008, 09:12 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

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
 
Old July 22nd, 2008, 07:28 AM
Authorized User
 
Join Date: Jun 2008
Posts: 17
Thanks: 1
Thanked 0 Times in 0 Posts
Default

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

 
Old July 22nd, 2008, 08:54 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

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

-Peter
compiledthoughts.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Pop-up problem lathika ASP.NET 2.0 Basics 2 July 26th, 2007 09:35 AM
Problem with Pop-up Menus JazzyJ Dreamweaver (all versions) 0 July 12th, 2006 12:17 AM
The problem with pop-up menu and dropdown list williamwang ASP.NET 1.0 and 1.1 Basics 1 April 14th, 2004 02:33 PM
inisiating a pop up message from the server yuvalk Classic ASP Basics 0 March 27th, 2004 01:23 PM





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