0

I am navigating from one page in to other pages, while navigating I am passing two query parameters in the javascript as

 var redirect_page = '<%= ResolveUrl("~/GUI/ReviewNEW.aspx") %>'+"?testDate=" + lDate;
 window.location = redirect_page; 

So the passed date is in the URL looks like

enter image description here

In the called page ReviewNEW.aspx.cs, I need to retrieve the query parameter testDate. I am using

private string l_Date = Request.QueryString["testDate"].ToString();

I am not sure if this will be converting in to 10/14/2016 so I can use this value in the select statement.

7
  • Can you print the value of redirect_page on console? Commented Nov 9, 2016 at 12:57
  • you could replace %2F with / if needed Commented Nov 9, 2016 at 12:57
  • @Rahul I just gave an alert statement to see how the value of the testDate is passed Commented Nov 9, 2016 at 12:59
  • @trx I am sorry I can not see that alert statement here. Is it in the image, if yes, can you print it in the question. I am unable to open the images of stackoverflow. Some firewall issue. Commented Nov 9, 2016 at 13:01
  • @Rahul This is the value we get for the testDate in URL 10%2F14%2F2016 I want them to be converted in to 10/14/2016 in the called page ReviewNEW.aspx.cs to do further processing. Commented Nov 9, 2016 at 13:38

1 Answer 1

1

Try this:

System.Web.HttpUtility.UrlDecode("12%2F10%2F2011+10%3A22%3A11");

Gives

"12/10/2011 10:22:11"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.