SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Jan 2004
    Location
    UK
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Text Format on ASP

    I've created my database on MS Access and linke it to the web using ASP. I can display data from db. The problem I have now is when I display a data from db on ASP page I get the text as one block with no spaces or paragraphs format. Can anybody give me a hand of how to display my text as I entered.

    Note: I stored text on field with memo type.

    Thanks

  2. #2
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The bes thing to do is change any line breaks to <br> when you pull it out:

    Code:
    TextVariable = Replace(TextVariable, VbNewLine, "<br>")

  3. #3
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    epsom
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    that is cool

    u helped me too.

    cheers

  4. #4
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    epsom
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would like to extend this.

    Do you know the best way to really format text such as change font, size, center text etc before it is sent to the database.?

    thanks

    nick

  5. #5
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would suggest not formatting text with font changes before you send it to the database, it's generally best to try and keep as much code as possible out of the database.

    This means that down the line, if you decide to change the way thing look, you don't need to change the data, just the way you format it when you pull it out.

    As for the actual formatting, it really depends what your wanting to do. If you want to be able to format, say, headings, different sections of text, then I would suggest looking at using custom tags (like vBulletins) which you can parse when you pull the data out.



Bookmarks

Posting Permissions

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