Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET VB.NET
Hi,
 
I have 3 asp.net pages HomePage.aspx, Page1.aspx & Page2.aspx.
 
Page1.aspx and Page2.aspx has a link through which I can go to HomePage.aspx.
 
My Question is:
In HomePage.aspx, how can I check a condition if the page has been opened from Page2.aspx or Page3.aspx?
 
I am not supposed to use querystring.
 
Please Help !!!
Posted 9-Nov-12 2:16am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

ok can use of session object fo example use of one session object that
initialize when user in page1 or page2 click on a button or link to go to home page.
in page1:
 session["PageName"]="Page1";
in page2:
 session["PageName"]="page2";
and in home page forexample ,you can do this:
 if(session["PageName"].Tostring()=="page1")
   //do somthing
 else if(session["PageName"].Tostring()=="page2")
   //do somthing
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

use javascript
 
function geturl()
{
 
var parenturl= window.opener.location.href
}
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 195
1 Peter Leow 130
2 Zoltán Zörgő 120
3 BillWoodruff 85
4 bling 70
0 Sergey Alexandrovich Kryukov 9,568
1 OriginalGriff 6,901
2 Peter Leow 4,737
3 Zoltán Zörgő 4,404
4 CHill60 2,932


Advertise | Privacy | Mobile
Web03 | 2.8.150129.1 | Last Updated 9 Nov 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100