Peter's Gekko

Sponsors

The Lounge

News

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
SmartNavigation and Redirect (not !) again

Some things just happen twice. I had been battling smart-navigation before. Trying to redirect from code on a page with smart-navigation switched on can lead to blank browser screens. The solution was to set smart navigation to false first before making the redirect. In some recent code I had forgotten about this and back were the troubles.

The bad thing is that it doesn't show up until the actuel user hits it. No problems with the code on my XP localhost. No problems when the sa (Running a localhost account ....) tried the app on the W2K production server. Blank screens when the domain user hits the page.

The easy way out is the smartnavigation tag in the aspx file.

<%@Page language="c#" Codebehind="default.aspx.cs" AutoEventWireup="false" Inherits="ProjektManager.Projekten" smartNavigation="True"%>

The sa can update that with notepad, asp.net will recompile the page. And the user can work again. Without smartnavigation on that particular page. Things could be worse :>

Peter

 


Posted 05-31-2004 7:45 PM by pvanooijen

[Advertisement]

Comments

Kuno wrote re: SmartNavigation and Redirect (not !) again
on 06-02-2004 6:12 AM
Hi Peter

... so, what's your point? Enabling the smartNavigation property in the page header directive does solve the blank page problem mentioned on the other post (http://dotnetjunkies.com/WebLog/petergekko/archive/2003/09/15/1609.aspx) without explicitly setting smartNavigation=false before Redirect()?

Thanks
Kuno
Peter van Ooijen wrote re: SmartNavigation and Redirect (not !) again
on 06-02-2004 6:41 AM
hi,

My point is that you want smartnavigation in most roundtrips of the page. But it will turn against you in case you do redirect.
Don't forget the page object is re-created on _every_ roundtrip.
Vrushali wrote re: SmartNavigation and Redirect (not !) again
on 10-24-2005 1:30 AM
Hi,
So what is the exact solution for redirecting the page when we use Smart navigation? Do we have to explicitly set it off before redirecting the page or what?please explain.
pvanooijen wrote re: SmartNavigation and Redirect (not !) again
on 10-24-2005 4:25 AM
It's the pagelifecycle !

You can use smartnavigation. But before issuing a redirect from code you have to switch it off. It will stay off for the remainder of handling _that_ request. On the next roundtrip/request it will be on again.

It's the pagelifecycle !

Add a Comment

(required)  
(optional)
(required)  
Remember Me?