Link to home
Start Free TrialLog in
Avatar of fritz_the_blank
fritz_the_blankFlag for United States of America

asked on

Determine name of calling page from an include file

Hello all--

I have a page let's say pageA.aspx that includes a page called pageB.aspx.

This pageB.aspx is called by most every page on the site.

I'd would like find the name of the page that calls the include pageB.aspx so that I could add conditional logic to pageB.aspx based on the name of the page that includes it. Is there an easy way to do this?

Thank you for reading my post.
Avatar of fritz_the_blank
fritz_the_blank
Flag of United States of America image

ASKER

In particular, I would like to do something like this on pageB.aspx:

If someCode(PageA) then
  'some code
Else
  'different code
End if
ASKER CERTIFIED SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you for your post. It gave me an idea that worked perfectly. On the main page, I declared a variable. On the include page, I checked to see if that variable existed. This saved me having to declare the variable on the header of each page.
You're welcome, glad to help.