Go to Comments





How to validate url parameters in C# without creation of additional variables


Created: 18/08/2012 09:33:17 p.m.








How to validate url parameters in C# without creation of additional variables
?

Example URL: www.mySite.com?idParam=23


if (((IList<string>)Request.QueryString.AllKeys).Contains("idParam"))
                Response.Redirect("~/MySiteFolter/MySite.aspx");


Advantage: You don't need to create additional variables, and no null object exceptions will be throw.









Comments: