PC Review


Reply
Thread Tools Rate Thread

Conditional Hyperlink in FP2000

 
 
Brooks Clayton
Guest
Posts: n/a
 
      31st Jan 2004
I have an asp page on my website pulling from an MS database. On this
page, among other data, is a FedEx tracking number. This tracking
number is a hyperlink and uses the following code:
http://www.fedex.com/cgi-bin/tracking?template_type=plugin&tracknumbers=<%=FP_FieldURL(fp_rs,"TrackingNo")%>&action=track&language=english&cntry_code=us

It works well, taking the viewer to the FedEx results page for that
number. The problem now is that we are also using Airborne and would
like for user to automatically be taken to Airborne's page for the
results, if it is an Airborne number. FedEx and Airborne use a
different number of characters in their tracking numbers.

Question: Can I use a conditional hyperlink based upon the lenth of
the tracking number? Like an IF statement? Any help or code
appreciated. (I have the code from Airborne for their site) Thanks

Brooks
 
Reply With Quote
 
 
 
 
Kevin Spencer
Guest
Posts: n/a
 
      31st Jan 2004
Sure you can. An ASP application generates dynamic HTML, so it can certainly
generate something as simple as a hyperlink. Here's an example:

<%
Dim strURL
If SomeVariableIdentifyingWhichVendor = "Airborne" Then
strURL = "http://Airborne.com"
Else
strURL =
"http://www.fedex.com/cgi-bin/tracking?template_type=plugin&tracknumbers=<%=
FP_FieldURL(fp_rs,"TrackingNo")%>&action=track&language=english&cntry_code=u
s"
End If
%>

<a href="<%=strURL%>">Click Here to go Somewhere</a>

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Brooks Clayton" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I have an asp page on my website pulling from an MS database. On this
> page, among other data, is a FedEx tracking number. This tracking
> number is a hyperlink and uses the following code:
>

http://www.fedex.com/cgi-bin/tracking?template_type=plugin&tracknumbers=<%=FP_FieldURL(fp_rs,"TrackingNo")%>&action=track&language=english&cntry_code=us
>
> It works well, taking the viewer to the FedEx results page for that
> number. The problem now is that we are also using Airborne and would
> like for user to automatically be taken to Airborne's page for the
> results, if it is an Airborne number. FedEx and Airborne use a
> different number of characters in their tracking numbers.
>
> Question: Can I use a conditional hyperlink based upon the lenth of
> the tracking number? Like an IF statement? Any help or code
> appreciated. (I have the code from Airborne for their site) Thanks
>
> Brooks



 
Reply With Quote
 
Brooks Clayton
Guest
Posts: n/a
 
      1st Feb 2004
Kevin,

Your reply was most helpful; thank you.

I have created the code below based upon your suggestion and the code
that I was using for FedEx. However, there are somethings wrong with
it; I suspect in the syntax. I have struggled with it, but have not
gotten it to work. Any suggestions?

<%
Dim strURL
If Len(<%=FP_FieldURL(fp_rs,"TrackingNo")%> = 11 Then
strURL=
"http://track.airborne.com/TrackByNbr.asp?ShipmentNumber="&<%=FP_FieldURL(fp_rs,"TrackingNo")%>
Else
strURL
="http://www.fedex.com/cgi-bin/tracking?template_type=plugin&tracknumbers=<%=FP_FieldURL(fp_rs,"TrackingNo")%>&action=track&language=english&cntry_code=us"
End If
%>

Thanks,

Brooks

On Sat, 31 Jan 2004 10:29:54 -0500, "Kevin Spencer"
<(E-Mail Removed)> wrote:

>Sure you can. An ASP application generates dynamic HTML, so it can certainly
>generate something as simple as a hyperlink. Here's an example:
>
><%
>Dim strURL
>If SomeVariableIdentifyingWhichVendor = "Airborne" Then
> strURL = "http://Airborne.com"
>Else
> strURL =
>"http://www.fedex.com/cgi-bin/tracking?template_type=plugin&tracknumbers=<%=
>FP_FieldURL(fp_rs,"TrackingNo")%>&action=track&language=english&cntry_code=u
>s"
>End If
>%>
>
><a href="<%=strURL%>">Click Here to go Somewhere</a>
>
>--
>HTH,
>Kevin Spencer
>.Net Developer
>Microsoft MVP
>Big things are made up
>of lots of little things.
>
>"Brooks Clayton" <(E-Mail Removed)> wrote in message
>news:(E-Mail Removed)...
>> I have an asp page on my website pulling from an MS database. On this
>> page, among other data, is a FedEx tracking number. This tracking
>> number is a hyperlink and uses the following code:
>>

>http://www.fedex.com/cgi-bin/tracking?template_type=plugin&tracknumbers=<%=FP_FieldURL(fp_rs,"TrackingNo")%>&action=track&language=english&cntry_code=us
>>
>> It works well, taking the viewer to the FedEx results page for that
>> number. The problem now is that we are also using Airborne and would
>> like for user to automatically be taken to Airborne's page for the
>> results, if it is an Airborne number. FedEx and Airborne use a
>> different number of characters in their tracking numbers.
>>
>> Question: Can I use a conditional hyperlink based upon the lenth of
>> the tracking number? Like an IF statement? Any help or code
>> appreciated. (I have the code from Airborne for their site) Thanks
>>
>> Brooks

>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FP2000 - hyperlink to perform multiple actions =?Utf-8?B?RGFudGVzTA==?= Microsoft Frontpage 8 19th Apr 2007 10:20 AM
Link Nav Button To Hyperlink - FP2000 Dick Microsoft Frontpage 1 2nd Apr 2007 11:20 PM
Conditional hyperlink? y_not Microsoft Excel Misc 2 24th Nov 2005 04:02 PM
How to set hyperlink when table field has no data - FP2000 asp Michael Edwards Microsoft Frontpage 2 18th Jan 2005 08:48 PM
Adding hyperlink makes images vanish in FP2000 Jim Thompson Microsoft Frontpage 6 27th Oct 2004 12:40 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:57 PM.