INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

ASP Classic duplicated variables

ASP Classic duplicated variables

(OP)
At the top of an classic asp page I set the variable:
CustomerID = Request.QueryString("CustomerID")

At the bottom is a back button. When they click it more than once the CustomerID duplicates appending the same value with commas.

<input type="button" value="Next Week ----->" onclick="window.location.href = 'InvoiceItem_list1Week.asp?txtDate=plusweek&CustomerName=CustomerName&CustomerID=<%=CustomerID%>'">


Any ideas on how to prevent appending duplicates?

Regards,

Rob

RE: ASP Classic duplicated variables

>Any ideas on how to prevent appending duplicates?
I think the problem would be in the code that executes in InvoiceItem_list1Week.asp ?? For starters, you should show that code.

RE: ASP Classic duplicated variables

(OP)
I may have figured it out. But I need some understanding of how to handle a value passed with spaces & '&':

This causes duplicates:
<input type="button" value="Next Week ----->" onclick="window.location.href = 'InvoiceItem_list1Week.asp?txtDate=plusweek&CustomerName=CustomerName&CustomerID=<%=CustomerID%>'">

This does NOT:
<input type="button" value="Next Week ----->" onclick="window.location.href = 'InvoiceItem_list1Week.asp?txtDate=plusweek&CustomerID=<%=CustomerID%>&CustomerName=CustomerName'">

Key her is putting the value which has spaces and other special characters in it last.

Regards,

Rob

RE: ASP Classic duplicated variables

Quote:

I may have figured it out. But I need some understanding of how to handle a value passed with spaces & '&':

URLEncode()

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind this jesus character, stars had to die for me to live.

RE: ASP Classic duplicated variables

I agree with Chris about Server.URLEncode, but I still don't get how this causes "duplicates appending the same value with commas". Has to be something in the code in InvoiceItem_list1Week.asp, and I'm not sure the URLEncode will fix that?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close