[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Server Side Navigation

Posted on 2007-11-28
3
Medium Priority
?
523 Views
Last Modified: 2010-04-21
This is not an exam or homework

You are writing server side code in a page load event. If the user comes to your Web site before noon, you want to redirect him to the page "morning.aspx". Which of the following code snippets should you use to accomplish this?


1.
If DateTime.Now.Hour < 12 Then
      Response.Transfer("morning.aspx")
End If

2.
If DateTime.Now.Hour < 12 Then
      Response.Redirect("morning.aspx")
End If

3.
If DateTime.Now.Hour < 12 Then
      Request.Redirect("morning.aspx")
End If

4.
If DateTime.Now.Hour < 12 Then
      Request.Transfer("morning.aspx")
End If
0
Comment
Question by:cybernation989
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
Munawar Hussain earned 2000 total points
ID: 20364314
This could be helpful for the given scenario but would not change the URL but would give the target page.
server.Transfer("morning.aspx")

The alternate option is
 Response.Redirect("morning.aspx")
0
 

Author Closing Comment

by:cybernation989
ID: 31411369
http://msdn2.microsoft.com/en-us/library/ms524309.aspx as some good info on how Response.Redirect works. I'm no where close to understanding it all but good stuff
0
 

Author Comment

by:cybernation989
ID: 20364370
http://msdn2.microsoft.com/en-us/library/ms524309.aspx as some good info on how Response.Redirect works. I'm no where close to understanding it all but good stuff
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question