post request and redirect

J

joshtichauer

Hey, Is there a way to make a javascript post request to MyPage.aspx,
set a variable on MyPage.aspx, then do a javascript redirect to
MyPage.aspx and still sustain the value of the variable posted to the
page in the first place? As of now i'm successfully posting to my aspx
page, and successfully redirecting as well, but i have been
unsuccessful with sustaining that variable. I've tried using ViewState
as well as Session, neither seem to work exactly how i'd like.

Essencially, I'm trying to send a post request as well as redirect to
the same page

Any/All suggestions or other ideas to accomplish this task are
welcome.

thanks to all,
JoshT
 
P

Peter Michaux

Hey, Is there a way to make a javascript post request to MyPage.aspx,
set a variable on MyPage.aspx, then do a javascript redirect to
MyPage.aspx and still sustain the value of the variable posted to the
page in the first place?

Write the value to a cookie with JavaScript before posting it. Then
read the value from the cookie with JavaScript after the redirection.

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top