Warning: First parameter must either be an object or the name of an existing class in H:\root\home\amrsaafan-001\www\nilebits\wp-content\themes\porto\inc\functions\general.php on line 1051

Warning: First parameter must either be an object or the name of an existing class in H:\root\home\amrsaafan-001\www\nilebits\wp-content\themes\porto\inc\functions\general.php on line 1051

Warning: First parameter must either be an object or the name of an existing class in H:\root\home\amrsaafan-001\www\nilebits\wp-content\themes\porto\inc\functions\general.php on line 1051
2010 | Page 2 Of 2 | Nile Bits

Yearly Archives - 2010

A potentially dangerous Request.Form value was detected from the client ASP.NET

I got this error message when I try to submit a form with HTML Code, the default settings of the .NET Framework will not allow me to submit HTML Code to prevent cross-site scripting (XSS) attacks. To avoid this error set Validate Request to false in the Page Directive.ValidateRequest="false" but this is not recommended.

How to remove HTML tags from string in C#

I will show you three different methods to remove HTML tags from string in C#: 1. By using Regex: public static string RemoveHTMLTags(string html) { return Regex.Replace(html, "<.*?>", string.Empty); } 2. By using Compiled Regex for better performance: static Regex htmlRegex = new Regex("<.*?>", RegexOptions.Compiled); public static string RemoveHTMLTagsCompiled(string html) { return htmlRegex.Replace(html, string.Empty); } 3. By using Char Array for...