Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Smart ASP pages?!?! 2

Status
Not open for further replies.

NiteCrawlr

Programmer
Mar 16, 2001
140
BR
Hi,
I would like to know if there is anyway I could create a "smart" ASP page, I have a site where the index page is a frame page which is divided in three.
My question is, can I make the the ASP page detects if it is being called from within the index page or if it is being called directly, if I type in the IE the address of the page (not the index page) I want it to instead of loading in the IE I want it to call the index page?
 
You could do this with client-side script by checking the parent elemts or you could create a querystring variable in your links like so:
Code:
page1.asp
<%
Option Explicit

If Request.QueryString(&quot;ind&quot;) = &quot;&quot; Then
   Response.Redirect &quot;index.asp&quot;
End If

'your code as usual
%>
In your pages now you could change your link to page1.asp to
Code:
<a href=&quot;page1.asp?ind=y&quot;>Go To Page 1</a>
.
If you add the above code to all but your index page and then always pass that querystring value, then anytime a user types in the page address without it, they would be redirected to index.asp
-Tarwn ------------ My Little Dictionary ---------
Reverse Engineering - The expensive solution to not paying for proper documentation
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top