Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB 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 October 2nd, 2010, 11:02 PM
Authorized User
 
Join Date: Sep 2010
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Default repeating code??

when we put a code in drop down list to change the theme, we put the Response.Redirect(Request.Url.ToString()); which causes the page to load again , so the pre init event occurs, then the page load event occurs, then the drop down list event occurs again which causes in my opinion another Response.Redirect(Request.Url.ToString()); and so on the events will repeat, isn't this right?
 
Old October 3rd, 2010, 06:07 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
and so on the events will repeat, isn't this right?
Did you try it out and did you get in an infinite loop? Nope; which shows this isn't the case.

When you redirect, you request a new page which is in no way associated with the previous one. So, when the new page is requested, the SelectedIndexChanged of the drop down list doesn't occur and the page doesn't post back to the server.

Does this explain things?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
repeating data ph0neman Classic ASP Basics 5 January 18th, 2008 12:34 PM
Repeating Region DynaCube Classic ASP Basics 0 January 12th, 2007 11:26 PM
repeating tables gianca Infopath 1 November 29th, 2006 01:27 AM
Repeating Records Nicky_uk Classic ASP Databases 7 February 2nd, 2005 05:41 PM
Repeating textboxes Robert_Hill BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 September 2nd, 2004 10:42 AM





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