Posted By

daverussellr on 09/16/10


Tagged

querystring mappedUrl


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Tyster


Check For Key in Querystring in MappedUrl


 / Published in: C#
 

Check for a key in a querystring on a mappedUrl. ie: Will find a key in a querystring when appended to a friendly Url.

  1. if (Request.RawUrl.Contains("keyid")) {
  2. var qstring = Request.RawUrl.Substring(Request.RawUrl.IndexOf("?") + 1, Request.RawUrl.Length - Request.RawUrl.IndexOf("?") - 1);
  3.  
  4. NameValueCollection query = HttpUtility.ParseQueryString(qstring);
  5. var keyId = query["keyid"];
  6.  
  7. }

Report this snippet  

You need to login to post a comment.