Visualizzazione dei risultati da 1 a 8 su 8

Discussione: formattazione testo ??

  1. #1
    Utente di HTML.it
    Registrato dal
    Apr 2001
    Messaggi
    84

    formattazione testo ??

    in un database access ho fatto un campo di tipo memo e ci inserisco
    del testo tipo un racconto o una poesia ecc.
    quando vado ad estrarre il record mi stampa a video tutto bene solo che le righe di testo non vanno a capo come sono scritte nel campo del database ma riempiono la cella html sconvolgendo il senso del testo scritto.
    Come faccio per far andare a capo il testo quando va a capo nel database?
    potete vedere un'esempio qui:
    http://www.essevueffe.it/irideverde/default.asp

    questo è il codice della pagina:

    <%@LANGUAGE="VBSCRIPT"%>
    <html>
    <head>
    <title>Documento senza titolo</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link href="tema.css" rel="stylesheet" type="text/css">
    </head>
    <%
    Sub Pagina()
    Dim RS
    %>



    <body>

    <table width="765" border="0" cellpadding="0" cellspacing="0">

    <tr>
    <td width="40" rowspan="2" valign="top"></td>
    <td width="397" height="36"></td>
    <td width="141"></td>
    <td width="187"></td>
    </tr>
    <tr>
    <td height="18" valign="top" class="txt-12-nero">I miei scritti divisi per
    categoria </td>
    <td valign="top" class="txt-12-nero"> <div align="center"><%= Date()%> </div></td>
    <td></td>
    </tr>
    <tr>
    <td height="19" colspan="4" valign="top"></td>
    </tr>
    <tr>
    <%'............................................... ......nessuna categoria scelta
    If Request("cat") = "" Then
    Set RS = Server.CreateObject("ADODB.Recordset")
    SQL = "SELECT DISTINCT categoria FROM testi ORDER by categoria ASC"
    iniz_cat='"&cat1&"' ORDER by categoria ASC"
    RS.Open SQL, Conn, adOpenStatic, adLockOptimistic
    %>
    <td height="70" colspan="4" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">

    <tr>
    <td width="577" height="20" valign="top" class="txt-14B-nero">Categorie</td>
    <td width="188"></td>
    </tr>
    <tr>
    <td height="20" colspan="2" valign="top"></td>
    </tr>
    <tr>
    <td height="30" colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
    <% Do while Not RS.Eof %>
    <td width="382" height="30" valign="top" class="txt-12-nero">" class="txt-12-nero"><%=RS("categoria")%></td>
    <%
    RS.MoveNext
    If Not RS.Eof Then
    %>
    <td width="383" valign="top" class="txt-12-nero">" class="txt-12-nero"><%=RS("categoria")%></td>
    </tr>
    <%
    RS.MoveNext
    End If
    Loop
    RS.Close
    Set RS = Nothing
    %>
    </table></td>
    </tr>
    </table></td>
    <% Else %>
    <%'............................................... ......estrazione dei titoli per la categoria
    cat = replace(request("cat"), "'", "''")
    If Request("id") = "" Then
    Set RS = Server.CreateObject("ADODB.Recordset")
    SQL = "SELECT * FROM testi WHERE categoria = '"&cat&"' ORDER by titolo ASC"
    RS.Open SQL, Conn, adOpenStatic, adLockOptimistic
    %>
    </tr>
    <tr>
    <td height="70" colspan="4" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">

    <tr>
    <td width="577" height="20" valign="top" class="txt-14B-nero">Categorie</td>
    <td width="188"></td>
    </tr>
    <tr>
    <td height="20" colspan="2" valign="top"></td>
    </tr>
    <tr>
    <td height="30" colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
    <% Do while Not RS.Eof %>
    <tr>
    <td width="382" height="30" valign="top" class="txt-12-nero">" class="txt-12-nero"><%=RS("titolo")%></td>
    <%
    RS.MoveNext
    If Not RS.Eof Then
    %>
    <td width="383" valign="top" class="txt-12-nero">" class="txt-12-nero"><%=RS("titolo")%></td>
    </tr>
    <%
    RS.MoveNext
    End If
    Loop
    RS.Close
    Set RS = Nothing
    %>
    </table></td>
    </tr>
    </table>
    <%
    End If
    'Else
    %> </td>
    </tr>
    <tr>
    <td height="95" colspan="4" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">

    <%'............................................... ......estrazione del testo
    If Request("id") <> "" Then
    id = Request("id")
    Set RS = Server.CreateObject("ADODB.Recordset")
    SQL = "SELECT * FROM testi WHERE id = "&Request("id")&""
    RS.Open SQL, Conn, adOpenStatic, adLockOptimistic
    %>
    <tr>
    <td height="20" colspan="3" valign="top">Categorie
    - Titoli</td>
    </tr>
    <tr>
    <td height="30" colspan="3" valign="top"><div align="center" class="txt-14B-nero"><%=RS("titolo")%> </div></td>
    </tr>
    <tr>
    <td height="25" colspan="3" valign="top" class="txt-10-nero"> <div align="center">di
    - <span class="txt-10B-nero"><%=RS("autore")%></span></div></td>
    </tr>
    <tr>
    <td width="75" height="20"></td>
    <td width="590" valign="top" class="txt-12-nero"><%=RS("testo")%></td>
    <td width="100"></td>
    </tr>
    </table></td>
    </tr>
    <%
    Else
    'Response.Redirect "racconti.asp"
    End If
    End If
    %>
    </table>
    </body>
    </html>
    <% End Sub %>

  2. #2
    Io inserisco nel testo i caratteri
    e faccio uso di Javascript e un testo nascosto per gestire il tutto .

    Non conosco soluzioni + eleganti purtroppo . . .

  3. #3
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    codice:
    <td width="590" valign="top" class="txt-12-nero"><%=replace(RS("testo"), VbCrLf, "
    ")%></td>
    Roby

  4. #4


    Miiinkia ! Mi hai levato non so quanti problemi Roby !



    Grande !

  5. #5
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Originariamente inviato da DarioN1


    Miiinkia ! Mi hai levato non so quanti problemi Roby !



    Grande !
    :master:

  6. #6
    Utente di HTML.it
    Registrato dal
    Apr 2001
    Messaggi
    84
    Grazie roby72 sei un grande...


  7. #7
    Utente di HTML.it L'avatar di diegoctn
    Registrato dal
    May 2001
    Messaggi
    2,118
    Originariamente inviato da DarioN1


    Miiinkia ! Mi hai levato non so quanti problemi Roby !



    Grande !

    Roby toglie tanti problemi a tutti..... ....ogni tanto un bel GRAZIE ROBY ci sta tutto....

  8. #8
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Originariamente inviato da diegoctn
    Roby toglie tanti problemi a tutti..... ....ogni tanto un bel GRAZIE ROBY ci sta tutto....
    :maLOL:

    Ogni tanto qualche bella 50,00 Euro ci starebbe meglio...

    Roby

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.