How to remove span tags from html in asp.net?
Posted on 2006-06-06
I have a treeview that has nodes with text that I change the background on by doing the following:
Now to send this data back to the database I need to strip off the <Span> tags
I tried the function below but it doesn't seem to be working:
I am passing in data like so:
text="<span style="backgroundcolor:gray">30606009 : 30</span> <b></b>"
Function RemoveHTMLTags(ByVal text)
Dim regex As New System.Text.RegularExpressions.Regex("<[^>]+>")
Return regex.Replace(text, String.Empty)
Can anyone help me with this?