Home All Groups Group Topic Archive Search About

displaying text on asp page from access



Author
16 Mar 2006 2:26 PM
raj chahal
Hi there

I've created a db field with Memo type, and I have stored some text with
carriage returns (no html) So the 3 words start on a differnt line. In
access this displays correctly ( each word starts on a new line).
However when I display these on a web page all the words appear on the same
line.

I need the words to be displayed on a seperate line.

ANY HELP APPECIATED.

thanks

Author
16 Mar 2006 5:22 PM
McKirahan
Show quote
"raj chahal" <i***@digitise.info> wrote in message
news:#tnXXYQSGHA.5552@TK2MSFTNGP14.phx.gbl...
> Hi there
>
> I've created a db field with Memo type, and I have stored some text with
> carriage returns (no html) So the 3 words start on a differnt line. In
> access this displays correctly ( each word starts on a new line).
> However when I display these on a web page all the words appear on the
same
> line.
>
> I need the words to be displayed on a seperate line.
>
> ANY HELP APPECIATED.

sText = {your text on multiple lines}

<%=Replace(sText,vbCrLf,"<br>")%>

or

<pre>
<%=sText%>
</pre>
Author
17 Mar 2006 9:32 AM
raj chahal
Thanks for your help.

Can I also give the user to make a piece of text bold without a 'rich text
editor'. If not any recommendations?
Thanks in advance..

Show quote
"McKirahan" <N***@McKirahan.com> wrote in message
news:TKWdnQE-muaHPYTZnZ2dnUVZ_s-dnZ2d@comcast.com...
> "raj chahal" <i***@digitise.info> wrote in message
> news:#tnXXYQSGHA.5552@TK2MSFTNGP14.phx.gbl...
> > Hi there
> >
> > I've created a db field with Memo type, and I have stored some text with
> > carriage returns (no html) So the 3 words start on a differnt line. In
> > access this displays correctly ( each word starts on a new line).
> > However when I display these on a web page all the words appear on the
> same
> > line.
> >
> > I need the words to be displayed on a seperate line.
> >
> > ANY HELP APPECIATED.
>
> sText = {your text on multiple lines}
>
> <%=Replace(sText,vbCrLf,"<br>")%>
>
> or
>
> <pre>
> <%=sText%>
> </pre>
>
>
>
>
>
Author
17 Mar 2006 12:22 PM
McKirahan
Show quote
"raj chahal" <i***@digitise.info> wrote in message
news:OTMq9YaSGHA.196@TK2MSFTNGP10.phx.gbl...
> Thanks for your help.
>
> Can I also give the user to make a piece of text bold without a 'rich text
> editor'. If not any recommendations?
> Thanks in advance..
>
> "McKirahan" <N***@McKirahan.com> wrote in message
> news:TKWdnQE-muaHPYTZnZ2dnUVZ_s-dnZ2d@comcast.com...
> > "raj chahal" <i***@digitise.info> wrote in message
> > news:#tnXXYQSGHA.5552@TK2MSFTNGP14.phx.gbl...
> > > Hi there
> > >
> > > I've created a db field with Memo type, and I have stored some text
with
> > > carriage returns (no html) So the 3 words start on a differnt line. In
> > > access this displays correctly ( each word starts on a new line).
> > > However when I display these on a web page all the words appear on the
> > same
> > > line.
> > >
> > > I need the words to be displayed on a seperate line.

[snip]

You'd have to know which word or words they want to be in bold.

One way is to have them start each line they want in bold with a period;
(or some other special character -- change the value of "cCHR" to it).

Then you could do this:

<%
Const cCHR = "."
    sText = {your text on multiple lines}
    aTemp = Split(sText,vbCrLf)
For iTemp = 0 To UBound(aTemp)
    sTemp = aTemp(iTemp)
    If  Left(sTemp,1) = cCHR Then
        aTemp(iTemp) = "<b>" & Mid(sTemp,2) & "</b>"
   End If
Next
    sText = Join(aTemp,"<br>")
%>

<%=sText%>

The above is untested -- let me know if there's a problem.

AddThis Social Bookmark Button