Wednesday, October 3, 2012

C# - Convert HTML To Plain Readable Text

I have working with rich text editor in SharePoint and needed to read the plain text to put in title of a list item.
Here is the code I came up with to solve. You can also use this in ASP.NET but you need to use HtmlDecode .

Tuesday, October 2, 2012

Add Or Update Url Parameter using C# for ASP.NET

Several times when working on ASP.NET I need to redirect the user to same page / refresh the page and I wanted to do that with preserving Querystring.
The follow code will add new query string parameter if not exist otherwise it will update the value of that parameter and make sure you have reference the following:

using System.Text;
using System.Text.RegularExpressions;
using System.Web;