.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Sandeep Singh
Melody Anderson
Eminent IT

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

User Cannot go directly to a specific page

Posted By: Anup     Posted Date: December 10, 2009    Points:2   Category :ASP.Net

I have 3 pages(Page1, Page2, Page3) in my Application,

Now the problem is that I don't want the User to go directly to Page 2 or Page 3. User should be redirected to Page 1, if they do so.

How this can be achieved?

"There has to be evil so that good can prove its purity above it."
- Gautam Buddha

- Anup

Author: Venkat             
Posted Date: December 10, 2009     Points: 5   


You can achieve your requirement using Javascript Just paste this code inside the page 2 and 3

<script language='Javascript'>

if(history.length <= 0)
window.location.href = "Page1.aspx";


Mark As Answer if this solve your problem
Warm Regards,
Author: Lincy Lucy             
Posted Date: December 10, 2009     Points: 5   

You can use Server.Transfer for this


With regards
Lincy Lucy
Exclusive offers & Discount on each order.Come and visit the beauty of God's Own Country

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend