Ask a Question related to ASP, Design and Development.

  1. #1

    Default 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=companycontacts.asp?Company=" & rstContacts(1).Value
    & " target=_new><img src=images\contact.ico width=25
    height=25 border=0></a></td>")

    Thanks for our help
    Mark

    Mark Sippitt Guest

  2. Similar Questions and Discussions

    1. Spaces in column value
      I have a column table in which the values have spaces, i.e. "2005 CRA 696." In my query, I want to account for various ways people may type that...
    2. Multiple Spaces
      I want to type in multiple spaces in a text area, like ( ). How can I do this? Thanks David
    3. Non-breaking spaces???
      Hi - I'm creating a justified text area in a graphic, but I want to be able to control the line breaks so that the company name doesn't split. ...
    4. [PHP] Removing Spaces
      Jason Williard wrote: $new_string = str_replace(' ','',$old_string); ? -- ---John Holmes... Amazon Wishlist:...
    5. Removing Spaces
      In parsing a file, I ended up with a number of variables that include spaces. Is there an easy way to remove a space from a variable? Jason
  3. #2

    Default Re: Spaces

    Two things:
    1. Use Chr(34) to put quotes around the href.
    2. Use Server.UrlEncode to encode the link.

    like this:

    Response.Write("<td align=center><a
    href="&Chr(34)&"companycontacts.asp?Company=" &
    Server.UrlEncode(rstContacts(1).Value)&Chr(34)&
    & " target=_new><img src=images\contact.ico width=25
    height=25 border=0></a></td>")

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

    Function PrintEncoded(strValue)
    If IsNull(strValue) Then
    PrintEncoded = ""
    Else
    PrintEncoded = Server.UrlEncode(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=companycontacts.asp?Company=" & rstContacts(1).Value
    > & " target=_new><img src=images\contact.ico width=25
    > height=25 border=0></a></td>")
    >
    > Thanks for our help
    > Mark
    >
    Shailesh Humbad Guest

  4. #3

    Default Re: Spaces

    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" <msippitt@hotmail.com> wrote in message news:<081d01c35cb1$9f40b290$a501280a@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=companycontacts.asp?Company=" & rstContacts(1).Value
    > & " target=_new><img src=images\contact.ico width=25
    > height=25 border=0></a></td>")
    >
    > Thanks for our help
    > Mark
    Mats Guest

  5. #4

    Default Re: Spaces

    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><img src=images\contact.ico width=25
    > height=25 border=0></a></td>
    <%
    then restart your asp code here
    %>

    Vivek


    "Mark Sippitt" <msippitt@hotmail.com> wrote in message
    news:081d01c35cb1$9f40b290$a501280a@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=companycontacts.asp?Company=" & rstContacts(1).Value
    > & " target=_new><img src=images\contact.ico width=25
    > height=25 border=0></a></td>")
    >
    > Thanks for our help
    > Mark
    >

    vivek Guest

  6. #5

    Default Re: Spaces

    Response.Write "<td align=""center"">" & _
    "<a href=""companycontacts.asp?Company=" & _
    rstContacts(1).Value & _
    """ target=_new>" & _
    "<img src=""images\contact.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="companycontacts.asp?Company=Andark Marine"><img
    src="images\contact.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" <msippitt@hotmail.com> wrote in message
    news:081d01c35cb1$9f40b290$a501280a@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=companycontacts.asp?Company=" & rstContacts(1).Value
    > & " target=_new><img src=images\contact.ico width=25
    > height=25 border=0></a></td>")
    >
    > Thanks for our help
    > Mark
    >

    Tom B Guest

  7. #6

    Default Re: Spaces

    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 [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Mark Sippitt Guest

  8. #7

    Default Re: Spaces

    It didnt work??

    Vivek

    "Mark Sippitt" <msippitt@hotmail.com> wrote in message
    news:eQ1WiROXDHA.3268@tk2msftngp13.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 [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    vivek Guest

  9. #8

    Default Re: Spaces

    Why wouldn't it work. I do that sort of thing all the time.
    "Mark Sippitt" <msippitt@hotmail.com> wrote in message
    news:eQ1WiROXDHA.3268@tk2msftngp13.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 [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    Tom B Guest

  10. #9

    Default Re: Spaces

    The parameter value should also be urlencoded

    Response.Write "<td align=""center"">" & _
    "<a href=""companycontacts.asp?Company=" & _
    Server.URLEncode(rstContacts(1).Value) & _
    """ target=_new>" & _
    "<img src=""images\contact.ico"" width=""25""
    height=""25"" border=""0""></a></td>"


    --
    Mark Schupp
    --
    Head of Development
    Integrity eLearning
    Online Learning Solutions Provider
    [email]mschupp@ielearning.com[/email]
    [url]http://www.ielearning.com[/url]
    714.637.9480 x17


    "Tom B" <shuckle@hotmail.com> wrote in message
    news:%23jKJBMOXDHA.656@tk2msftngp13.phx.gbl...
    > Response.Write "<td align=""center"">" & _
    > "<a href=""companycontacts.asp?Company=" & _
    > rstContacts(1).Value & _
    > """ target=_new>" & _
    > "<img src=""images\contact.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="companycontacts.asp?Company=Andark
    Marine"><img
    > src="images\contact.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" <msippitt@hotmail.com> wrote in message
    > news:081d01c35cb1$9f40b290$a501280a@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=companycontacts.asp?Company=" & rstContacts(1).Value
    > > & " target=_new><img src=images\contact.ico width=25
    > > height=25 border=0></a></td>")
    > >
    > > Thanks for our help
    > > Mark
    > >
    >
    >

    Mark Schupp Guest

  11. #10

    Default Spaces

    Just a quick one, how can I add a space between words in my formtomail script. i know that by putting & VbCrLf
    & it adds a line break but I need to be able to add a space.

    --
    Regards,
    Chris.

    [url]www.chrisf.has.it[/url]
    [url]www.lascoronas10.has.it[/url]
    [url]www.boro.rules.it[/url]
    [url]www.chrisfuni.has.it[/url]


    [Chris F] Guest

  12. #11

    Default Re: Spaces

    [Chris F] wrote on 09 sep 2003 in
    microsoft.public.inetserver.asp.general:
    > Just a quick one, how can I add a space between words in my formtomail
    > script. i know that by putting & VbCrLf & it adds a line break but I
    > need to be able to add a space.
    >
    & " " &

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan. Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139