Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
how to create breaks in blocks of text
Old 04-30-2006, 04:12 PM how to create breaks in blocks of text
redgeordieboy99's Avatar
Skilled Talker

Posts: 61
Trades: 0
ive created a website that has a page to display news in, it is basically text and a picture. The problem i have is taht i want to have breaks in the text i.e. new paragraphs etc but i cant. i am using as access database and for this page it is a single table with three variables

NewsID - autonumber
NewsPic - text
newstext - memo

i have tried inserting the breaks as spaces and by pressing enter but no luck it just bunches all the text together.

I know there are lots of things wrong with the site and im working through them one at a time but if your interested here is the site

www.petwise.org.uk
redgeordieboy99 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-30-2006, 04:45 PM Re: how to create breaks in blocks of text
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
you either need to put the HTML code into the database or use placeholders in the database and replace them on display.

if the text in the memo field is formatted on entry with carriage returns and tabs you can do
Code:
strText = objRS.fields("newstext")
strText = replace(strText,vbCRLf,"<br>")
strtext = replace(strText,vbTab,"&nbsp;"&nbsp;&nbsp;")
you could also enclose the text in <pre> tags to retain the text format then style the tag to suit
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-30-2006, 06:28 PM Re: how to create breaks in blocks of text
redgeordieboy99's Avatar
Skilled Talker

Posts: 61
Trades: 0
where would i put this code
redgeordieboy99 is offline
Reply With Quote
View Public Profile
 
Old 04-30-2006, 10:35 PM Re: how to create breaks in blocks of text
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
Between the point at which you're retrieving the info and the point at which it's displayed.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 05-01-2006, 07:41 AM Re: how to create breaks in blocks of text
redgeordieboy99's Avatar
Skilled Talker

Posts: 61
Trades: 0
please exscuse my ignorance but i can not find where to put this code. below is the code for the page in question

<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/Petwise.asp" -->
<%
Dim rsNewsView
Dim rsNewsView_numRows

Set rsNewsView = Server.CreateObject("ADODB.Recordset")
rsNewsView.ActiveConnection = MM_Petwise_STRING
rsNewsView.Source = "SELECT * FROM News ORDER BY NewsID DESC"
rsNewsView.CursorType = 0
rsNewsView.CursorLocation = 2
rsNewsView.LockType = 1
rsNewsView.Open()

rsNewsView_numRows = 0
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html><!-- InstanceBegin template="/Templates/Main.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Petwise</title>
<!-- InstanceEndEditable --><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="PetStyle.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_goToURL() { //v3.0
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//-->
</script>
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
</head>

<body onLoad="MM_preloadImages('images/button-home-down2.png','images/button-news-down2.png','images/button-products-down2.png','images/button-game-down2.png','images/button-findus-down2.png','images/button-contact-down2.png')">
<table width="930" border="0" align="center" cellpadding="0" cellspacing="0">
<tr align="left" valign="top">
<td width="40" height="139" class="BorderTopLeft">&nbsp;</td>
<td width="850" height="139" class="Header">&nbsp;</td>
<td width="40" height="139" class="BorderTopRight">&nbsp;</td>
</tr>
<tr align="left" valign="top">
<td width="40" height="30" class="BorderUpright">&nbsp;</td>
<td width="850" height="30"><a href="javascript:;" onClick="MM_goToURL('parent','home.html');return document.MM_returnValue" onMouseOver="MM_swapImage('Image1','','images/button-home-down2.png',1)" onMouseOut="MM_swapImgRestore()"><img src="images/button-home-up2.png" name="Image1" width="145" height="30" border="0" id="Image1"></a><a href="javascript:;" onClick="MM_goToURL('parent','news.asp');return document.MM_returnValue" onMouseOver="MM_swapImage('Image2','','images/button-news-down2.png',1)" onMouseOut="MM_swapImgRestore()"><img src="images/button-news-up2.png" name="Image2" width="141" height="30" border="0" id="Image2"></a><a href="javascript:;" onClick="MM_goToURL('parent','products.asp');retur n document.MM_returnValue" onMouseOver="MM_swapImage('Image3','','images/button-products-down2.png',1)" onMouseOut="MM_swapImgRestore()"><img src="images/button-products-up2.png" name="Image3" width="141" height="30" border="0" id="Image3"></a><a href="javascript:;" onClick="MM_goToURL('parent','game.html');return document.MM_returnValue" onMouseOver="MM_swapImage('Image4','','images/button-game-down2.png',1)" onMouseOut="MM_swapImgRestore()"><img src="images/button-game-up2.png" name="Image4" width="141" height="30" border="0" id="Image4"></a><a href="javascript:;" onClick="MM_goToURL('parent','find.html');return document.MM_returnValue" onMouseOver="MM_swapImage('Image5','','images/button-findus-down2.png',1)" onMouseOut="MM_swapImgRestore()"><img src="images/button-findus-up2.png" name="Image5" width="141" height="30" border="0" id="Image5"></a><a href="javascript:;" onClick="MM_goToURL('parent','contact.asp');return document.MM_returnValue" onMouseOver="MM_swapImage('Image6','','images/button-contact-down2.png',1)" onMouseOut="MM_swapImgRestore()"><img src="images/button-contact-up2.png" name="Image6" width="141" height="30" border="0" id="Image6"></a></td>
<td width="40" height="30" class="BorderUpright">&nbsp;</td>
</tr>
<tr align="left" valign="top">
<td width="40" class="BorderSpacer">&nbsp;</td>
<td width="850"><!-- InstanceBeginEditable name="Content" -->
<table width="850" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20" rowspan="3">&nbsp;</td>
<td height="40" colspan="3" align="left" valign="top" class="HeadingNews">&nbsp;</td>
<td width="20" rowspan="3">&nbsp;</td>
</tr>
<tr>
<td width="500" align="left" valign="top" class="TextMain"><%=(rsNewsView.Fields.Item("NewsT ext").Value)%></td>
<td width="20">&nbsp;</td>
<td width="290" align="left" valign="top"><img src="<%=(rsNewsView.Fields.Item("NewsPic").Value)% >"></td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
</table>
<!-- InstanceEndEditable --></td>
<td width="40" class="BorderSpacer">&nbsp;</td>
</tr>
<tr align="left" valign="top">
<td width="40" height="40" class="BorderBottomLeft">&nbsp;</td>
<td width="850" height="40" align="center" class="BorderBottom"><a href="sitemap.html">Sitemap</a> | <a href="privacy.html">Privacy Policy</a> | Copyright &copy; 2006 </td>
<td width="40" height="40" class="BorderBottomRight">&nbsp;</td>
</tr>
</table>
</body>
<!-- InstanceEnd --></html>
<%
rsNewsView.Close()
Set rsNewsView = Nothing
%>
redgeordieboy99 is offline
Reply With Quote
View Public Profile
 
Old 05-01-2006, 07:44 AM Re: how to create breaks in blocks of text
redgeordieboy99's Avatar
Skilled Talker

Posts: 61
Trades: 0
i have tried to place it just before the the dynamic text line 81 but all i get is the page displays but the text doesnt and placing just after creating the recordset the page doesnt display at all
redgeordieboy99 is offline
Reply With Quote
View Public Profile
 
Old 05-01-2006, 07:44 AM Re: how to create breaks in blocks of text
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
here

<td width="500" align="left" valign="top" class="TextMain"><%=(rsNewsView.Fields.Item("NewsT ext").Value)%></td>
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to how to create breaks in blocks of text
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.51211 seconds with 12 queries