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

Server.URLEncode

Status
Not open for further replies.

JackD4ME

Programmer
Jun 4, 2002
228
US
I have a loop in which I am using Server.URLEncode to data from a recordset. There are 3 fields in which I use this. When I encode the last 2, the page works. When I encode the first record, it does not. I tested it by using the record w/w/o encoding. The page works with the data when the first is not encoded. Does anyone know why this might be happening? (The unitid code works w/o encoding)

<td><A HREF =&quot;/oilgas/unitind.asp?unitd=<%=Server.URLEncode(rscon(&quot;unitid&quot;))%>&quot;><%=rscon(&quot;unitid&quot;)%></A>
<td><A HREF =&quot;/oilgas/leaseind.asp?ln=<%=rscon(&quot;leasenumber&quot;)%>&quot;><%=rscon(&quot;leasenumber&quot;)%></A>
<td><%=rscon(&quot;leasename&quot;)%>
<td><A HREF =&quot;/oilgas/opind.asp?OpId=<%=Server.urlencode(rscon(&quot;opid&quot;))%>&quot;><%=rscon(&quot;opid&quot;)%></A>
 
what type of data is &quot;unitid&quot;?

does this test below work for you?
Code:
<%
strVar = 10 & &quot; foo bar ! @ # $&quot;
response.write(&quot;not encoded: &quot; & strVar & &quot;<br />&quot; &_
  &quot;encoded: &quot; & server.urlencode(strVar))
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top