Link to home
Start Free TrialLog in
Avatar of Aleks
AleksFlag for United States of America

asked on

pass url parameter as session

I currently have a link from a web page

<script language="javascript">
window.location.href="qnr_08_session.asp?Partiescontid=<%=LASTINSERTEDID%>";
</script>

then I send to a page that creates a session variable and redirect to another page.
<%
Session("temppartyid") = Request.QueryString("Partiescontid")
%>

Is there a way to skip this middle page and pass the URL variable as the session variable or create it on the fly ?

Also, when moving the mouse over the link it shows the URL and the parameter, if this can be hidden that would be even better, if not at least see if its possible to skip the second page. and pass the session directly from the first link into the third page.
Avatar of Big Monty
Big Monty
Flag of United States of America image

If there is no other processing going on in that middle page, then just redirect to the third page and access the value by doing Request.QueryString("Partiescontid")
Avatar of Aleks

ASKER

Because client asked me not to show the URL parameter on the page, if I use a session it won't show. Otherwise they can change it and end up seeing a different record
Then wherever you set LASTINSERTEDID, at the Session variable. Then there's no need to put it in the QueryString
Avatar of Aleks

ASKER

I have the same situation in a repeated region, with a link like this:

<a href="qnr_08_session.asp?Partiescontid=<%=(rs_parties.Fields.Item("userid").Value)%>" class="btn btn-white  tooltip-demo"><i class="fa fa-folder" data-toggle="tooltip" data-placement="top" title="Edit family member"></i></a>

Open in new window


It passes the URL to page 2 which creates the session then redirects to page 3. If there is no workaround then thats what it is, just trying to find a way to skip that page
Do you want the values all in one session variable or separate session variables?
Avatar of Aleks

ASKER

In this case its just one parameter, so one session will do.
ASKER CERTIFIED SOLUTION
Avatar of Big Monty
Big Monty
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Aleks

ASKER

Thanks. I will give this a try later today
Avatar of Aleks

ASKER

Ill assign the points now. Will implement later this week.