hi
i have two pages default.aspx and view.aspx,
default.aspx has hyperlink control and on code behind file in page load event i have written this
Hyperlink.NavigateUrl = "view.aspx?ReturnUrl=" + HttpUtility.UrlEncode(Request.Url.AbsolutePath);
and on view.aspx i have 1 more hyperlink i have written this on code behind file page load event
BackHyperLink.NavigateUrl = HttpUtility.UrlEncode(Request.QueryString["ReturnUrl"]);
when i click Back hyperlink i am getting this error
HTTP Error 400 - Bad Request.
Can anyone help me plz.
Thanks
Getting error HTTP Error 400 - Bad Request when usiing hyperlink with query string
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Krishna GaradRank #191 · 12.8K reputationPosted Mar 6, 2011, 6:39 PM EST
Welcome to Csharpcorner
Normally this error occur when we are trying to access the resource which is not available. In your case check out view.aspx location means see is it present in any directory.If it is then try like
Hyperlink.NavigateUrl = "~/view.aspx?ReturnUrl=" +
HttpUtility.UrlEncode(Request.Url.AbsolutePath);
As well your target url must be able to Decode.
programmerAt3 reputationPosted Mar 6, 2011, 8:14 PM EST