View Single Post
  #6 (permalink)  
Old Nov 14th, 2007, 09:21
robbied72 robbied72 is offline
Up'n'Coming Member
Join Date: Sep 2007
Location: Wales, UK
Age: 35
Posts: 88
Thanks: 1
Thanked 0 Times in 0 Posts
Send a message via MSN to robbied72 Send a message via Skype™ to robbied72
Re: Formatting Passed Value Within ASP Page In Textarea?

Hi Monie, I have expanded on Alex's PHP example in ASP:

HTML: Select all
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>.:: ASP [quote] replace example ::.</title>
<style type="text/css">
<!--
#quote {
    width: 95%;
    border-top-width: 1px;
    border-right-width: 1px;
    border-bottom-width: 1px;
    border-left-width: 1px;
    border-top-style: solid;
    border-right-style: solid;
    border-bottom-style: solid;
    border-left-style: solid;
    border-top-color: #000000;
    border-right-color: #CCCCCC;
    border-bottom-color: #CCCCCC;
    border-left-color: #000000;
    font-family: Arial, Helvetica, sans-serif;
    font-size:0.8em;
    padding:3px;
}
#quote em {
    color:#FF0000;
}
h5 {
    font-family:Arial, Helvetica, sans-serif;
    font-size:0.7em;
    color:#000;
    margin-bottom:1px;
}
-->
</style>
</head>
<body>
<%
'-----Data colection and replace---------------------------------
'The values below would be collected dynamically, I have placed 
'them statically for this example.
'----------------------------------------------------------------
dim vQuote, vUser
vUser = "alexgeek"
vQuote = "[quote]This is the original message from Alex![/quote]"
vQuote = Replace(vQuote,"[quote]","<em>")
vQuote = Replace(vQuote,"[/quote]","</em>")
%>
<h5>Quote:</h5>
<div id="quote">
<%
'-----Output Quote------------------------------------------------
Response.Write("Originaly Posted by <b>"&vUser&"</b><br />")
Response.Write(vQuote)
%>
</div>
</body>
</html>
Hope this helps

Last edited by Monie; Nov 27th, 2007 at 07:58.
Reply With Quote