Products

>  AspTear
>  CodeLook
>  PortalPage Filter

 

Support

>  FAQ
>  Documentation
>  Ask Us!

 

Free Tools

>  Free Components
>  Free Sourcecode
>  IIS Development
>  SharpDevelop

 

Leistungen

>  Webprogrammierung
>  Schulungen
>  Datenbanken
>  Netzwerk

 

Service

>  Über uns
>  Referenzen
>  Kontaktinformationen
>  Anfrageformular

Home | Products | Support Central | Buy! | About Us  

Creating Portal Page Links

This document describes how to create links on your pages that allow the linked pages to be indexed by spiders while not having to change the linked pages themselves. You learn how to use the supporting ASP function library of PortalPageFilter.

The ASP Function Library

The ASP function library is contained in the file ppfhelpers.asp, which you can download with the Sample Application. It helps you to automatically convert links like

http://www.mywebstore.com/product.asp?pid=20001

to

http://www.mywebstore.com/PPF/pid/20001/product.asp

It contains the following functions:

Function GenerateURLFromArray(ByVal strURI, ByRef arrParameters, ByRef arrValues)
Function GenerateURL_OneParam(ByVal strURI, ByRef strParamName, ByRef strParamValue)
Function GenerateThis_OneParam(ByRef strParamName, ByRef strParamValue)
Function GenerateThis_FromArray(ByRef arrParameters, ByRef arrValues)

The functions perform the following tasks:

  • GenerateURLFromArray: You pass in an URL, an array of parameter names, and an array of parameter values. The portal page link is created based on these parameters.
  • GenerateURL_OneParam: You pass in an URL, and one parameter name and one parameter value. The portal page link is created based on these parameters.
  • GenerateThis_OneParam: You pass in a parameter name and value only. The portal page link is generated based on the SCRIPT_NAME server variable and the passed parameters.
  • GenerateThis_FromArray: You pass in an array of parameter names, and an array of parameter values. The portal page link is created based on the SCRIPT_NAME server variable and the passed arrays.

Using the Function Library

The Sample Application ships with a demonstration example named simpleconsumer.asp. It demonstrates how to use each of the ASP functions properly.

GenerateURLFromArray

The following code demonstrates how to use GenerateURLFromArray:

<!-- #include file="ppfhelpers.asp" -->
<%
strFilename = Request.ServerVariables("SCRIPT_NAME")
arrParameters = Array("name", "country")
arrValues = Array("Hans Mustermann", "Übersee")

strURL = GenerateURLFromArray(strFilename, arrParameters, arrValues)
%>

The resulting portal page link looks like this:

/PPF/name/Hans+Mustermann/country/%DCbersee/simpleconsumer.asp

A standard (non-indexable) URL with query string for this request would look like:

/simpleconsumer.asp?name=Hans+Mustermann&country=%DCbersee

GenerateURL_OneParam

The following code demonstrates how to use GenerateURL_OneParam:

<!-- #include file="ppfhelpers.asp" -->
<%
strFilename = Request.ServerVariables("SCRIPT_NAME")
strUrl = GenerateURL_OneParam(strFilename, "logourl", "/images/myfile.gif")
%>

The resulting portal page link looks like this:

/PPF/logourl/%2Fimages%2Fmyfile%2Egif/simpleconsumer.asp

GenerateThis_OneParam

The following code demonstrates how to use GenerateThis_OneParam:

<!-- #include file="ppfhelpers.asp" -->
<%
strUrl = GenerateThis_OneParam("name", "Mr. Yates")
%>

The resulting portal page link looks like this:

/PPF/name/Mr%2E+Yates/simpleconsumer.asp

GenerateThis_FromArray

The following code demonstrates how to use GenerateThis_FromArray:

<!-- #include file="ppfhelpers.asp" -->
<%
strUrl = GenerateThis_FromArray(Array("age","city"), Array(90,"Phoenix"))
%>

The resulting portal page link looks like this:

/PPF/age/90/city/Phoenix/simpleconsumer.asp

Related Frequently Asked Questions

Why don't you automatically rewrite URLs in outgoing pages?
Can I change the rewriting-prefix "PPF"?

 
 
© 1999-2015 AlphaSierraPapa. All Rights Reserved.
Back to the top.