Click here to Skip to main content
15,894,177 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
lblActionSummary.Text=Regex.Replace(lblActionSummary.Text, "<.*?>", string.Empty);


I am trying this .. I don't want to take browser contents HTML elements ...

but then if the information has paragraphs, certain spaces, bold, and italic elements. All gets skipped .. And I am unable to see the proper view. I just don't want to display background color on elements because my background color is already set and some font color, other than that it should use all HTML tags.

Please suggest.
Posted
Updated 27-Sep-13 9:32am
v2
Comments
Sergey Alexandrovich Kryukov 27-Sep-13 17:18pm    
Suggest what? So far, you say: "I want to skip tags, but I don't want to skip all tags". Well, skip what you want, but it won't be a good approach.
—SA
Torakami 30-Sep-13 3:07am    
lblActionSummary.Text=Regex.Replace(lblActionSummary.Text, "<.*?>", string.Empty); I used this to remove all html tags in the content .. but then now what i want to skip is i just want to skip perticular tags as its overrriding my css such as background color n all ... so please suggest how to skip selected tags
Torakami 30-Sep-13 3:13am    
It would be even nice if i can able to replace style attribute used in any tag ...
Sergey Alexandrovich Kryukov 30-Sep-13 12:24pm    
Okay, very good, replace just this. But you should not have "style" attributes, you have to have only "class" attributes, and only when you really need different styles for identical tags. How about that?
—SA
Torakami 30-Sep-13 12:32pm    
can you please explain that via any example ..

1 solution

Please see my comments to the question. Perhaps, you should not skip any HTML tags at all. If this is just the background colors, all you need to skip (or transform, for that matter), is CSS.

I hope your HTML uses CSS. (If colors are defined in some way other than CSS, think if you want to waste your time on such trash.)

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900