Please help with event attributes in an HTML string

I need to take a string that contains HTML and check it for Event Attributes (onclick, onmouseover, etc). Does anyone have a suggestion on how I can achieve this without specifically searching for dozens of attribute names?

An example would be, if the user tried to save:

<div onmouseout="alert('Hello!');"> 

I could reliably either strip out the attribute (best case) or at least detect the attribute (acceptable)?

by esdictor via /r/csharp

Leave a Reply