response.write from acccess problem, please help

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default response.write from acccess problem, please help

    I have a text in access database, annd it is copied from Word. Problem is
    that when I want to put it on screen, usin response.write, all paragrafs
    and new rows in tex are deleted, so when I want text to go in new row, on
    place where I pressed Enter, text is displayed like there is no new row.
    For example:

    I entered in database text:
    This is first row.
    This is second row.
    This is third row.

    It is displayed like:
    This is first row. Thhis is second row. This is third row.

    What to do? I know one option is to put <br> everytime I want to go to new
    row, but that is not an option for user.
    Please help.
    Crnaovca Guest

  2. Similar Questions and Discussions

    1. response.write URL
      I have a page which lists conferences and events which the company for which I coded the site attends or hosts themselves. They want to be able to...
    2. If response.write help
      Hi, I am trying to code my asp page so that if you are on page Y, the link to page Y in the nav, is in the over state to help users identify where...
    3. quotes in response.write
      Hi there, I want to do: response.write("bla bla bla "in quotes" bla bla") How do I show the quotes on the screen in asp like I have to do \"...
    4. Response.Write and Response.Redirect
      On my Page_Load event, i need to do some validation and then either let them proceed, or display a error message and boot them back to the previous...
    5. asp response.write doesn't display
      Maybe you could start with a more barebones file, especially one without an unclosed LINK tag:
  3. #2

    Default Re: response.write from acccess problem, please help

    In your database, you have Chr(10) & Chr(13) as a newline/linefeed
    combination.

    A browser doesn't render these. It uses HTML tags for rendering.

    Solution? Use Replace()

    <%
    Response.Write(Replace(strText, vbCrLF, "<br>" & vbCrLf))
    %>

    Cheers
    Ken

    "Crnaovca" <crnaovca@net.hr> wrote in message
    news:opr6yeniepr1tjnq@news.carnet.hr...
    : I have a text in access database, annd it is copied from Word. Problem is
    : that when I want to put it on screen, usin response.write, all paragrafs
    : and new rows in tex are deleted, so when I want text to go in new row, on
    : place where I pressed Enter, text is displayed like there is no new row.
    : For example:
    :
    : I entered in database text:
    : This is first row.
    : This is second row.
    : This is third row.
    :
    : It is displayed like:
    : This is first row. Thhis is second row. This is third row.
    :
    : What to do? I know one option is to put <br> everytime I want to go to new
    : row, but that is not an option for user.
    : Please help.


    Ken Schaefer Guest

  4. #3

    Default Re: response.write from acccess problem, please help

    I am doing things like that. But isn't there some other way? I cannot
    expect from user that everytime user posts some article, he has to write
    <br> instead of Enter. There must be some way to take aticle user has
    wrote and save it in some way that when I write it to screen it is written
    exaclty the same...
    Sorry for english....
    Crnaovca Guest

  5. #4

    Default Re: response.write from acccess problem, please help

    Hi,

    You have the user enter the text as they are currently entering it.

    When you write this to the screen, you dynamically replace the Chr(13) &
    Chr(10) that the user entered (by pressing [enter]) with "<br>"

    Just to be clear:
    THE USER DOES NOT HAVE TO ENTER <br> TAGS!

    Please reread the code snipped that I posted.

    Cheers
    Ken

    "Crnaovca" <crnaovca@net.hr> wrote in message
    news:opr6yjrtumr1tjnq@news.carnet.hr...
    : I am doing things like that. But isn't there some other way? I cannot
    : expect from user that everytime user posts some article, he has to write
    : <br> instead of Enter. There must be some way to take aticle user has
    : wrote and save it in some way that when I write it to screen it is written
    : exaclty the same...
    : Sorry for english....


    Ken Schaefer Guest

  6. #5

    Default Re: response.write from acccess problem, please help

    Save the text of your WORD as HTML and put this text into your database.


    Maarten Guest

  7. #6

    Default Re: response.write from acccess problem, please help

    NO!!!!!!!! Word makes awful, awful, awful HTML that is bloated and very
    difficult to read and manipulate. Please don't suggest this; the original
    poster just has a problem understanding that plain text and HTML are
    rendered differently, and the REPLACE() solution is the tidiest way to
    accommodate for the difference.

    --
    Aaron Bertrand
    SQL Server MVP
    [url]http://www.aspfaq.com/[/url]


    "Maarten" <nobody@spam.com> wrote in message
    news:Gxtic.84732$Ch1.5619820@phobos.telenet-ops.be...
    > Save the text of your WORD as HTML and put this text into your database.
    >
    >

    Aaron Bertrand [MVP] Guest

  8. #7

    Default Re: response.write from acccess problem, please help

    I don't have such problem. I understand that. But, as much replace
    function is tidy way of doing that, I suceeded not so long ago to
    retreive text from database, and it was displayed fine. I never used
    replace function till this day for such use but it still worked. Problem
    is that I cannot remember whhat I did, I used some other function, but I
    cannot remember what. Anyway, I want to thank Ken Shaefer for answer, I
    listened his advice.

    On Sat, 24 Apr 2004 18:43:43 -0400, Aaron Bertrand [MVP]
    <aaron@TRASHaspfaq.com> wrote:
    > NO!!!!!!!! Word makes awful, awful, awful HTML that is bloated and very
    > difficult to read and manipulate. Please don't suggest this; the
    > original
    > poster just has a problem understanding that plain text and HTML are
    > rendered differently, and the REPLACE() solution is the tidiest way to
    > accommodate for the difference.
    >


    --
    Using M2, Opera's revolutionary e-mail client: [url]http://www.opera.com/m2/[/url]
    Crnaovca Guest

  9. #8

    Default Re: response.write from acccess problem, please help

    Maybe the <PRE> tag. There aren't too many ways to render plain text as
    HTML...

    --
    Aaron Bertrand
    SQL Server MVP
    [url]http://www.aspfaq.com/[/url]


    "Crnaovca" <crnaovca@net.hr> wrote in message
    news:opr6z77sowr1tjnq@news.carnet.hr...
    >I don't have such problem. I understand that. But, as much replace function
    >is tidy way of doing that, I suceeded not so long ago to retreive text
    >from database, and it was displayed fine. I never used replace function
    >till this day for such use but it still worked. Problem is that I cannot
    >remember whhat I did, I used some other function, but I cannot remember
    >what. Anyway, I want to thank Ken Shaefer for answer, I listened his
    >advice.

    Aaron Bertrand [MVP] Guest

  10. #9

    Default Re: response.write from acccess problem, please help

    No, no... <pre> tag is for different use.
    Crnaovca Guest

  11. #10

    Default Re: response.write from acccess problem, please help

    However, it is the only other way I know of to render a manual carriage
    return as a carriage return in HTML, other than replace a CR/LF pair with an
    HTML <BR> tag.

    If you already know the answer, which your smug response implies, why don't
    you tell us?

    --
    Aaron Bertrand
    SQL Server MVP
    [url]http://www.aspfaq.com/[/url]


    "Crnaovca" <crnaovca@net.hr> wrote in message
    news:opr61bnxssr1tjnq@msnews.microsoft.com...
    > No, no... <pre> tag is for different use.

    Aaron Bertrand [MVP] 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