To get a QueryString value from the previous pages URL (aka: the UrlReferrer) you can use HttpUtility.ParseQueryString.
NameValueCollection nameValueCollection = HttpUtility.ParseQueryString(Request.UrlReferrer.Query); string keyword = nameValueCollection["kw"];
“And that’s all I have to say about that.”
4 thoughts on “C# How to get a QueryString value from the UrlReferrer”
nxt page ie:new.aspx
how to get value of k in new.aspx
I have tried this but my Request.UrlReferrer.Query is empty. Do you know any reason why the parameters are not being sent through
Request.UrlReferrer.Query is empty. Do you know any reason why the parameters are not being sent through