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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP Classic duplicated variables

Status
Not open for further replies.
Sep 17, 2001
672
0
0
US
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
 
>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.

 
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
 
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.
 
and;

thread333-306528

thread333-772870



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.
 
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?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top