Solved

Convert HTML tags to text

Posted on 2008-06-23
3
234 Views
Last Modified: 2013-11-19
Hi ,
i have an Obout control insteal of RTF Control in Asp. When i need to save something in the database the control allows me o save with the HTML tags associated with it.
suppose i have <br> hi this is test </br>  . the whole text field gets saved .
Qn 1. how can i remove the <br> tag or anyother tag and just insert the text contents.
Qn.2 i have already saved some with the html tags and how can i remove it.

and ofcourse this is in asp.net
0
Comment
Question by:sonukoshy
  • 3
3 Comments
 
LVL 15

Expert Comment

by:dosth
ID: 21844922
<%
Function stripHTMLtags(HTMLstring)

Set RegularExpressionObject = New RegExp

With RegularExpressionObject
.Pattern = "<[^>]+>"
.IgnoreCase = True
.Global = True
End With

stripHTMLtags = RegularExpressionObject.Replace(HTMLstring, "")
Set RegularExpressionObject = nothing

End Function
%>
0
 
LVL 15

Accepted Solution

by:
dosth earned 500 total points
ID: 21844930
0
 
LVL 15

Expert Comment

by:dosth
ID: 23979227
thanks for the points
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now