Solved

Server Side Navigation

Posted on 2007-11-28
3
516 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:
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
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 …
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

724 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