Solved

Server Side Navigation

Posted on 2007-11-28
3
501 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
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
needo_jee earned 500 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

808 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