Dealing with Requests in ASP

Dealing with Requests in ASPThis tutorial will teach you how to deal with requests in ASP. Requests are often seen in the form of http://www.mysite.com/page.asp?ID=x.THe ID=x is the request in the URL. This tutorial will show you how tochange the location of an iFrame using requests in one file.

Part I - ASP

First, we will use name our identifier "ID". If ID=vine, then theiFrame will point to grapevine.asp. If ID=tut, then the iFrame willpoint to tutorials.asp, and so on:

<%Dim pageIDDim iFramepageID = request("ID")If pageID = "vine" TheniFrame = "grapevine.asp"ElseIF pageID = "tut" TheniFrame = "tutorials.asp"ElseIf pageID = "contact" TheniFrame = "contact.asp"ElseiFrame = "home.asp"End If%>


Part II - HTML + IFrame


Now all we need is an iframe to point to and a variable to insert:

<iframe src="<%=iFrame %>" width=200 height=200 />

And thats it! Frame change on request! (pun intended)

Related Articles

Contact Web Design Outsource and get started today

Need Website Designing, Development, Redesigning, Maintenance and SEO services or help growing your company's web presence? Request a free Quote Now.