How to Remove HTML Tags ASP.NET(C#)

In some conditions we have to remove the HTML tags like
etc to be removed and stored the same text into a simple text form.Take an example of comment user form in website where the user is also inputing some HTML tags in the comment section and we want to remove that tags so we can save that data into our database.We can handle that situation very easily by using the function "RemoveHTMLTags" where are doing it with regular expression protected void Page_Load(object sender, EventArgs e) { string str = "Code platter software developers"; Response.Write(RemoveHTMLTags(str)); } public string RemoveHTMLTags(string source) { string expn = "<.>"; return Regex.Replace(source, expn, string.Empty); } note: Include System.Text.RegularExpressions namespace for the above code to work. ----------------------------------------------- About the author: PlanetSourceCode.in is a place for all developer providing free source codes, articles, complete projects,complete application in PHP, C/C++, Javascript, Visual Basic, Cobol, Pascal, ASP/VBScript, AJAX, SQL, Perl, Python, Ruby, Mobile Development -----------------------------------------------

Add new comment