Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,472
There are 1371 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     .NET and MSSQL :

Stripping HTML from an ASP code and then Trimming It

Thread title: Stripping HTML from an ASP code and then Trimming It
     
    Thread tools Search this thread Display Modes  
Prev Previous Post   Next Post Next
09-22-2010, 03:44 PM
#4
jimmykup is offline jimmykup
Status: I'm new around here
Join date: Apr 2010
Location:
Expertise:
Software:
 
Posts: 11
iTrader: 0 / 0%
 

jimmykup is on a distinguished road

  Old

I was able to figure this out using this code.

Code:
<%End if
	If Not rsItems.Eof Then
		sDescription = rsItems("WEBDESC")
		If Not rsParent.Eof Then%>

<%Function stripHTML(strHTML) 
	Dim objRegExp, strOutput
	Set objRegExp = New Regexp
	objRegExp.IgnoreCase = True
	objRegExp.Global = True
	objRegExp.Pattern = "<(.|\n)+?>"
	strOutput = objRegExp.Replace(strHTML, "")
	strOutput = Replace(strOutput, "<", "&lt;")
	strOutput = Replace(strOutput, ">", "&gt;")
	stripHTML = strOutput 'Return the value of strOutput
	Set objRegExp = Nothing
End Function%> 

<%=stripHTML(sDescription)%>

<%End if%>

Reply With Quote
     


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed