473,698 Members | 2,246 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Redirect Options

I need to add logic to the Page_Load event behind a site's default.aspx;
that will allow either default.aspx to load - OR load a completely different
page instead of default.aspx. The other pages to possibly load exist within
that site. The site owner says he wants to be able to specify any of his
existing pages as the site's default - and to change it whenever he wants.
So I'm adding a table to the db which will hold the site's "current
default.aspx". The Page_Load logic behind default.aspx will look to that
table to determine if it should continue to load itself or instead send a
different page altogether down to the browser.

I'd appreciate some advice on which of the redirection options I should use.
As I see it, here are the possibilities:
1. Response.Redire ct
2. Server.Transfer
3. HttpContext.Rew ritePath
4. Server.Execute
? other possibilities?

So, if you had this requirement, how would you go about implementing it?
Thoughts? Rationalle?

Thanks!
Nov 18 '05 #1
3 2946
I'd probably lean towards using RewritePath in an HttpModule with a
Begin_Request event handler. This would keep the logic of selecting
which page to execute outside of the page execution.

The drawbacks here are that you'll need to RewritePath a second time
to get the correct Action tags on any pages that POST back, and use
ResolveUrl to link to images in some scenarios. If this causes too
many problems, Server.Transfer might be easier imlementation wise.

I'd probably shy away from Response.Redire ct, not just because it
involves a round trip, but because the users will get the URL to the
"other" default page and might just bookmark it, meaning all the logic
and table setup will go to waste. Server.Execute could present the
same problems with POST backs as mentioned earlier.

--
Scott
http://www.OdeToCode.com/

On Thu, 7 Oct 2004 13:31:58 -0700, "Guadala Harry" <GM**@NoSpam.co m>
wrote:
I need to add logic to the Page_Load event behind a site's default.aspx;
that will allow either default.aspx to load - OR load a completely different
page instead of default.aspx. The other pages to possibly load exist within
that site. The site owner says he wants to be able to specify any of his
existing pages as the site's default - and to change it whenever he wants.
So I'm adding a table to the db which will hold the site's "current
default.aspx ". The Page_Load logic behind default.aspx will look to that
table to determine if it should continue to load itself or instead send a
different page altogether down to the browser.

I'd appreciate some advice on which of the redirection options I should use.
As I see it, here are the possibilities:
1. Response.Redire ct
2. Server.Transfer
3. HttpContext.Rew ritePath
4. Server.Execute
? other possibilities?

So, if you had this requirement, how would you go about implementing it?
Thoughts? Rationalle?

Thanks!


Nov 18 '05 #2
Hi Scott,
<<you'll need to RewritePath a second time to get the correct Action tags on
any pages that POST back>>

All of the pages that could be redirected to do in fact POST back... So,
given that fact, can it be an easy conclusion that I should just go with
Server.Transfer in order to have the "cleanest" implementation?

-GH


"Scott Allen" <bitmask@[nospam].fred.net> wrote in message
news:rv******** *************** *********@4ax.c om...
I'd probably lean towards using RewritePath in an HttpModule with a
Begin_Request event handler. This would keep the logic of selecting
which page to execute outside of the page execution.

The drawbacks here are that you'll need to RewritePath a second time
to get the correct Action tags on any pages that POST back, and use
ResolveUrl to link to images in some scenarios. If this causes too
many problems, Server.Transfer might be easier imlementation wise.

I'd probably shy away from Response.Redire ct, not just because it
involves a round trip, but because the users will get the URL to the
"other" default page and might just bookmark it, meaning all the logic
and table setup will go to waste. Server.Execute could present the
same problems with POST backs as mentioned earlier.

--
Scott
http://www.OdeToCode.com/

On Thu, 7 Oct 2004 13:31:58 -0700, "Guadala Harry" <GM**@NoSpam.co m>
wrote:
I need to add logic to the Page_Load event behind a site's default.aspx;
that will allow either default.aspx to load - OR load a completely differentpage instead of default.aspx. The other pages to possibly load exist withinthat site. The site owner says he wants to be able to specify any of his
existing pages as the site's default - and to change it whenever he wants.So I'm adding a table to the db which will hold the site's "current
default.aspx ". The Page_Load logic behind default.aspx will look to that
table to determine if it should continue to load itself or instead send a
different page altogether down to the browser.

I'd appreciate some advice on which of the redirection options I should use.As I see it, here are the possibilities:
1. Response.Redire ct
2. Server.Transfer
3. HttpContext.Rew ritePath
4. Server.Execute
? other possibilities?

So, if you had this requirement, how would you go about implementing it?
Thoughts? Rationalle?

Thanks!

Nov 18 '05 #3
That would be pretty clean, but I'd do a little prototyping to make
sure nothing odd happens for the exact architecture you are using.

--
Scott
http://www.OdeToCode.com/

On Thu, 7 Oct 2004 13:58:14 -0700, "Guadala Harry" <GM**@NoSpam.co m>
wrote:
Hi Scott,
<<you'll need to RewritePath a second time to get the correct Action tags on
any pages that POST back>>

All of the pages that could be redirected to do in fact POST back... So,
given that fact, can it be an easy conclusion that I should just go with
Server.Transfe r in order to have the "cleanest" implementation?

-GH


"Scott Allen" <bitmask@[nospam].fred.net> wrote in message
news:rv******* *************** **********@4ax. com...
I'd probably lean towards using RewritePath in an HttpModule with a
Begin_Request event handler. This would keep the logic of selecting
which page to execute outside of the page execution.

The drawbacks here are that you'll need to RewritePath a second time
to get the correct Action tags on any pages that POST back, and use
ResolveUrl to link to images in some scenarios. If this causes too
many problems, Server.Transfer might be easier imlementation wise.

I'd probably shy away from Response.Redire ct, not just because it
involves a round trip, but because the users will get the URL to the
"other" default page and might just bookmark it, meaning all the logic
and table setup will go to waste. Server.Execute could present the
same problems with POST backs as mentioned earlier.

--
Scott
http://www.OdeToCode.com/

On Thu, 7 Oct 2004 13:31:58 -0700, "Guadala Harry" <GM**@NoSpam.co m>
wrote:
>I need to add logic to the Page_Load event behind a site's default.aspx;
>that will allow either default.aspx to load - OR load a completelydifferent >page instead of default.aspx. The other pages to possibly load existwithin >that site. The site owner says he wants to be able to specify any of his
>existing pages as the site's default - and to change it whenever hewants. >So I'm adding a table to the db which will hold the site's "current
>default.aspx ". The Page_Load logic behind default.aspx will look to that
>table to determine if it should continue to load itself or instead send a
>different page altogether down to the browser.
>
>I'd appreciate some advice on which of the redirection options I shoulduse. >As I see it, here are the possibilities:
>1. Response.Redire ct
>2. Server.Transfer
>3. HttpContext.Rew ritePath
>4. Server.Execute
>? other possibilities?
>
>So, if you had this requirement, how would you go about implementing it?
>Thoughts? Rationalle?
>
>Thanks!
>


Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
30861
by: Andrew Chalk | last post by:
In a Python script running under CGI, can I programatically redirect the program to another page. Assume that I have a static HTML page that I want displayed (e.g. index.htm). Other than 'print ...' is there any way to redirect to this URL (for example, like Response.Redirect() in ASP)? Many thanks.
8
4886
by: Victor | last post by:
I need to redirect to another web page, but that redirect will include the submission of form data. So, unlike ServerXMLHTTP which stays on the originating web page, I need the script to redirect to the page that I'm submitting the POST data to (without pressing a submit button). Any suggestions? Thanks, Victor
4
2817
by: Van Duijn | last post by:
I use an inlineframe to display pages with images with javascript pop up links. These image pages redirect to each other with the trusted <meta http-equiv="refresh" content="10; url=vb9.htm"> metatag. Now this works perfectly well in Netscape and Firefox, but Internet Explorer is spoling the fun. After you click an image to open the popup box, the image pages (in the inlineframe) won't refresh anymore. As long as you don't click an...
9
15077
by: Glen | last post by:
I'm writing a console utility to download specific files from web sites based on the command line options. In most cases, I can trap the 404 error when the file isn't available because the operator mistyped the URL or it's offline for whatever reason. The problem I'm running into is with certain sites where the admin has set up a redirect to handle the 404 condition and redirects the request to another page. In this case, the...
3
1550
by: questions? | last post by:
I am calling system command in python by os.system() I do, os.system("wget http://blah blah blah") then I run the program by ./programname >redirected file The things put to screen doesn't redirect to the file I want. What's the trick in here? Thanks
0
2091
by: Stuart Palmer | last post by:
Hi everyone, I'm trying to look for an asp equivilent of .htaccess that is used on apache servers but for use with asp. I am doing a website and moving lots of files into a single directory to make it easier to maintain, however, I don't want to loose the search engine indexing that is already in place. What I would like to have is a db/.htacces-like files, that when a page doesn't exist the server redirect.
7
13446
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I am trying to set this up using asp code and IIS configuration. But it seems not working. Here it is the way I am doing. In IIS I set up a virtual directory with secure communication, I checked require secure channel, require 128-bit encryption. In custom error, instead of using default message HTTP 403.4 - Forbidden: SSL required Internet Information Services in iishelp 403.4htm, I am trying to do redirect automatically. so I...
8
4915
by: Darrel | last post by:
I'm helping convert a 300+ page .html site into an ASP.net site. The client wants to set up 301 redirects for all of the old html pages. I've used ISAPI for this type of thing in the past, as it works great and is easy to set up, but at this point, the client (which is my client, who's working with the actual client) doesn't know what the new web host supports. In the interim, I want to do a bit of research myself on this to see if it's...
3
15670
by: Sarah | last post by:
I was wondering if someone might be able to help me with this issue. I have a feeling this has something to do with my host's server settings as I used to be able to get CURL to follow redirects by setting CURLOPT_FOLLOWLOCATION set to true. I had a problem with my host's updating something in the past that gave me the error "CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set". My host worked on the...
0
8683
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8609
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9170
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9031
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8901
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8871
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7739
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4371
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2336
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.