Solved

Server Side Navigation

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Javascript - getdate 5 51
asp.net mvc5 3 38
Server error in 'XXXXXXXX' application. 12 51
Hidden Field Value 10 37
Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now