0

I have data in database as below: e.g.

<p><font style="BACKGROUND-COLOR: gold" size="+2" face="Arial Black"><strong>test</strong><u> test1</u> </font></p> 

I need to retrieve the data from my code and remove the html tags and apply the same element effect. if there is a tag like ,,, all these should be effected to the text provided.

so, here in above example the output will be likr test (in bold with font style) test1(with underline). testtest1

Please suggest to achive this in vb.net

  • [Here is one example of HTML string parsing with c#.net][1] [1]: http://stackoverflow.com/questions/56107/what-is-the-best-way-to-parse-html-in-c – Karan May 05 '15 at 11:29

2 Answers2

0

1) Example of HTML string parsing with C#.NET

2) http://htmlagilitypack.codeplex.com/ - This is commonly used server side parser. I would recommend this one.

3) It would be easier to manipulate the html object. Otherwise, you can try to parse with the help of string REGEX replacement and would be very tedious & complex piece to work on.

Community
  • 1
  • 1
Karan
  • 3,265
  • 9
  • 54
  • 82
0

VB.NET has got asp:Literal for this.

<asp:Literal ID="literal" runat="server" />

Use it in code like this.

Dim code As String = "<p><font style=""BACKGROUND-COLOR: gold"" size=""+2"" face=""Arial Black""><strong>test</strong><u> test1</u> </font></p>"
literal.Text = code
naveen
  • 53,448
  • 46
  • 161
  • 251