How To Know Previous Page

W

Wang

Suppose I have three pages A.aspx, B.aspx, and C.aspx.

A and B each have a hyperlink that opens C. The hyperlink is identical on A
and B, and has no querystring parameters.

The user opens A.

The user then clicks the link to open C.

When C is opened, how can it "know" it was opened from A and not B? I need
for logic in page C's code-behind/Page_load() event to take different action
based on which page C was opened from (A or B or any other page in the
application.

Please note that I cannot hard-code or even table-drive a querystring
parameter into the hyperlink on each page that would provide this
information.

Thanks!
 
W

Wang

Any other ideas?
I already tried that: it appears that 'Request.UrlReferrer' is available
only on postbacks. At least I found it to be null during page_load(), while
it was there on postbacks (which is useless because during a postback you
already know the requesting page because the page is being requested by
itself - so to speak). Or am I missing something?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top