473,594 Members | 2,829 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 2607
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
11095
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
14991
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
6268
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
11839
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
7430
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
12403
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
17500
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
4801
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
2950
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
4727
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
7877
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8253
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8374
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8009
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8240
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
6661
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...
0
5411
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
3867
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...
1
2389
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

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.