On my aspx page, I am dealing with a query string - www.mysite.com/enter.aspx?dest=#
. After clicking "enter," the page navigates to main.aspx
. I am looking for a way to extract this "?dest=#" from the query string in main.aspx
using either request.querystring
or some javascript code. This extracted information will be used for another action on main.aspx.
Does anyone have any suggestions?
Let me provide more details -
I have a page called enter.aspx which loads with a query string attached -
www.mysite.com/enter.aspx?dest=#
. When the user clicks the Enter button on enter.aspx, the page redirects to main.aspx. On main.aspx, I want to implement a small block of JavaScript that captures the query string passed from the previous enter.aspx page and performs an if condition based on it.
So, if (request.querystring('dest=') > 0) {
window.open ('a1.jpg');
}
This code snippet needs revision to make it functional. How can this be achieved?
I tried using window.location.href.indexOf('dest'), but it did not yield the desired result.