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;

No comments: