[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Server Side Navigation

Posted on 2007-11-28
3
Medium Priority
?
525 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:
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Suggested Courses

834 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