473,915 Members | 3,834 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Spaces

I have a problem with the following code :

Response.write rstContacts(1). Value

The above line prints "Andark Marine"

However the following only passes "Andark" and stops at
the space. How do I get over this ? Its the same with all
records.

Response.Write( "<td align=center><a
ref=companycont acts.asp?Compan y=" & rstContacts(1). Value
& " target=_new><im g src=images\cont act.ico width=25
height=25 border=0></a></td>")

Thanks for our help
Mark

Jul 19 '05 #1
8 2617
Two things:
1. Use Chr(34) to put quotes around the href.
2. Use Server.UrlEncod e to encode the link.

like this:

Response.Write( "<td align=center><a
href="&Chr(34)& "companycontact s.asp?Company=" &
Server.UrlEncod e(rstContacts(1 ).Value)&Chr(34 )&
& " target=_new><im g src=images\cont act.ico width=25
height=25 border=0></a></td>")

If rst may contain nulls, then put urlencode into a function like this:

Function PrintEncoded(st rValue)
If IsNull(strValue ) Then
PrintEncoded = ""
Else
PrintEncoded = Server.UrlEncod e(strValue)
End If
End Function

UrlEncode will give an error if it is given a null value.

Shailesh.

Mark Sippitt wrote:
I have a problem with the following code :

Response.write rstContacts(1). Value

The above line prints "Andark Marine"

However the following only passes "Andark" and stops at
the space. How do I get over this ? Its the same with all
records.

Response.Write( "<td align=center><a
ref=companycont acts.asp?Compan y=" & rstContacts(1). Value
& " target=_new><im g src=images\cont act.ico width=25
height=25 border=0></a></td>")

Thanks for our help
Mark


Jul 19 '05 #2
Generally yo can't have spaces in a Querystring, parsing stops at the
space.(I've seen somewhere that Apache might tolerate it)
Mats
"Mark Sippitt" <ms******@hotma il.com> wrote in message news:<08******* *************** ******@phx.gbl> ...
I have a problem with the following code :

Response.write rstContacts(1). Value

The above line prints "Andark Marine"

However the following only passes "Andark" and stops at
the space. How do I get over this ? Its the same with all
records.

Response.Write( "<td align=center><a
ref=companycont acts.asp?Compan y=" & rstContacts(1). Value
& " target=_new><im g src=images\cont act.ico width=25
height=25 border=0></a></td>")

Thanks for our help
Mark

Jul 19 '05 #3
why use response.write to display a link which has zillion double quotes, to
put it in a more simple way do this:

end you asp tag
%>

<td align="center"> <a href="contacts. asp?company=<%= rstContacts(1). Value %>"
target=_new><im g src=images\cont act.ico width=25
height=25 border=0></a></td>
<%
then restart your asp code here
%>

Vivek
"Mark Sippitt" <ms******@hotma il.com> wrote in message
news:08******** *************** *****@phx.gbl.. . I have a problem with the following code :

Response.write rstContacts(1). Value

The above line prints "Andark Marine"

However the following only passes "Andark" and stops at
the space. How do I get over this ? Its the same with all
records.

Response.Write( "<td align=center><a
ref=companycont acts.asp?Compan y=" & rstContacts(1). Value
& " target=_new><im g src=images\cont act.ico width=25
height=25 border=0></a></td>")

Thanks for our help
Mark

Jul 19 '05 #4
Response.Write "<td align=""center" ">" & _
"<a href=""companyc ontacts.asp?Com pany=" & _
rstContacts(1). Value & _
""" target=_new>" & _
"<img src=""images\co ntact.ico"" width=""25""
height=""25"" border=""0""></a></td>"

All I've done is add double quotes around the properties of your tags. The
result will be
<td align="center"> <a href="companyco ntacts.asp?Comp any=Andark Marine"><img
src="images\con tact.ico" width="25" height="25" border="0"></a></td>

I've never tried but I'm pretty sure an ico file isn't going to show up on
IE

"Mark Sippitt" <ms******@hotma il.com> wrote in message
news:08******** *************** *****@phx.gbl.. .
I have a problem with the following code :

Response.write rstContacts(1). Value

The above line prints "Andark Marine"

However the following only passes "Andark" and stops at
the space. How do I get over this ? Its the same with all
records.

Response.Write( "<td align=center><a
ref=companycont acts.asp?Compan y=" & rstContacts(1). Value
& " target=_new><im g src=images\cont act.ico width=25
height=25 border=0></a></td>")

Thanks for our help
Mark

Jul 19 '05 #5
Vivek,

I think you will find that method also does not work unfortunately, but
agree with you about the clarity, without the complication of double
quotes...

Mark Sippitt MIAP
Senior Developer

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #6
It didnt work??

Vivek

"Mark Sippitt" <ms******@hotma il.com> wrote in message
news:eQ******** ******@tk2msftn gp13.phx.gbl...
Vivek,

I think you will find that method also does not work unfortunately, but
agree with you about the clarity, without the complication of double
quotes...

Mark Sippitt MIAP
Senior Developer

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 19 '05 #7
Why wouldn't it work. I do that sort of thing all the time.
"Mark Sippitt" <ms******@hotma il.com> wrote in message
news:eQ******** ******@tk2msftn gp13.phx.gbl...
Vivek,

I think you will find that method also does not work unfortunately, but
agree with you about the clarity, without the complication of double
quotes...

Mark Sippitt MIAP
Senior Developer

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 19 '05 #8
The parameter value should also be urlencoded

Response.Write "<td align=""center" ">" & _
"<a href=""companyc ontacts.asp?Com pany=" & _
Server.URLEncod e(rstContacts(1 ).Value) & _
""" target=_new>" & _
"<img src=""images\co ntact.ico"" width=""25""
height=""25"" border=""0""></a></td>"
--
Mark Schupp
--
Head of Development
Integrity eLearning
Online Learning Solutions Provider
ms*****@ielearn ing.com
http://www.ielearning.com
714.637.9480 x17
"Tom B" <sh*****@hotmai l.com> wrote in message
news:%2******** *******@tk2msft ngp13.phx.gbl.. .
Response.Write "<td align=""center" ">" & _
"<a href=""companyc ontacts.asp?Com pany=" & _
rstContacts(1). Value & _
""" target=_new>" & _
"<img src=""images\co ntact.ico"" width=""25""
height=""25"" border=""0""></a></td>"

All I've done is add double quotes around the properties of your tags. The result will be
<td align="center"> <a href="companyco ntacts.asp?Comp any=Andark Marine"><img src="images\con tact.ico" width="25" height="25" border="0"></a></td>

I've never tried but I'm pretty sure an ico file isn't going to show up on
IE

"Mark Sippitt" <ms******@hotma il.com> wrote in message
news:08******** *************** *****@phx.gbl.. .
I have a problem with the following code :

Response.write rstContacts(1). Value

The above line prints "Andark Marine"

However the following only passes "Andark" and stops at
the space. How do I get over this ? Its the same with all
records.

Response.Write( "<td align=center><a
ref=companycont acts.asp?Compan y=" & rstContacts(1). Value
& " target=_new><im g src=images\cont act.ico width=25
height=25 border=0></a></td>")

Thanks for our help
Mark


Jul 19 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
11158
by: Michael Bulatovich | last post by:
I have a simple db to keep track of work/time/projects etc. It has two fields (column) named "start time" and "end time" WITH THE SPACES. I'm trying to do some automation to a form associated with the db and notice that in all the examples I've seen nobody EVER includes spaces in the names of fields. Now I'm getting a sinking feeling.... Can anyone quickly outline the kinds of problems I'm going to encounter with these names? --
11
15027
by: gopal srinivasan | last post by:
Hi, I have a text like this - "This is a message containing tabs and white spaces" Now this text contains tabs and white spaces. I want remove the tabs and white spaces(if it more than once between two words). Is there any function we have in C which will find out the tabs and white spaces and returns the text in the follwong way -
9
6289
by: Durgesh Sharma | last post by:
Hi All, Pleas help me .I am a starter as far as C Language is concerned . How can i Right Trim all the white spaces of a very long (2000 chars) Charecter string ( from the Right Side ) ? or how can i make a fast Right Trim Function in c,using Binary search kind of fast algorithm ? Offcourse...I can use the classical approach too. like : Start from the right most charecter of the string to the left of the
17
11915
by: tommy | last post by:
Hi all, I' m adding strings to some fields in my table via Access. The strings sometimes have trailing spaces and I really need to have it that way, but Access truncates trailing spaces. How can I force Access not to truncate?! Thanx, /Toommy
135
7600
by: Xah Lee | last post by:
Tabs versus Spaces in Source Code Xah Lee, 2006-05-13 In coding a computer program, there's often the choices of tabs or spaces for code indentation. There is a large amount of confusion about which is better. It has become what's known as “religious war” — a heated fight over trivia. In this essay, i like to explain what is the situation behind it, and which is proper.
3
12425
by: Luke - eat.lemons | last post by:
Hi, Could someone tell me the correct quotation to get around spaces in paths for: Server.MapPath("\\server\share\spaces in name.mdb") I know its bad practice to use spaces but unfortunately i cannot help this.
8
17520
by: Joe Cool | last post by:
I need to map several columns of data from one database to another where the data contains multiple spaces (once occurance of a variable number or spaces) that I need to replace with a single space. What would be the most efficient way to do this? I am using SQL2K. I was thinking a function since I know of no single Transact-SQL command that can accomplish this task.
3
4841
by: bstjean | last post by:
Hi everyone, I am trying to find an efficient way to perform a special query. Let me explain what I want. Let's say we are looking for all description that match "this is the target". In fact, I want to find records that match those 4 words in this sequence disregarding the number of spaces (I mean spaces, tabs, Cr, Lf, etc) between them.
5
2970
by: brian.j.parker | last post by:
Hey all, I've noticed an obscure little quirk: it appears that if you use a login with trailing spaces on the name, SYSTEM_USER automatically trims those trailing spaces in SQL Server 2000, but not SQL Server 2005. Anybody know if this change in behavior is documented? If it is intentional? Is there a "quick fix" to revert to the old behavior (to automatically RTRIM the results of SYSTEM_USER in 2005) until code can be changed?
8
4748
by: drjay1627 | last post by:
hello, This is my 1st post here! *welcome drjay* Thanks! I look answering questions and getting answers to other! Now that we got that out of the way. I'm trying to read in a string and add the unique words in the string to a map. Eg:
0
10039
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
10543
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9734
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8102
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7259
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5944
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6149
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4779
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4346
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.