views:

59

answers:

2

I have the following problem

I have a web framework built with classic asp that saves the page state in hidden textboxes, and then issues a submit to itself.

Before submitting, we have a javascript functions that saves the action in a hidden "action" input, and then performs the submit.

The page loads the state from those hidden texts, reads the action issued, reads extra parameters, like the id of the record to edit, and then builds the page accordingly.

I'd like to make a url link to automatically start the page with "edit" action on a "x" id.

So I was thinking about building the following url, for example

http://myapp/user?action=edit&id=23

the problem is that when the page auto-submits, que url string keeps the parameters.

I'd like to achieve the following:

when the user clicks on

http://myapp/user?action=edit&id=23

my page should receive the posted values action=edit and id=23

but the url should be just http://myapp/user

and both parameters should be kept in the hidden texts... (I wonder if I make myself clear...)

thanks a lot

saludos

sas

ps: I have a couple of ideas about how to solve it, but I'll post them as answers...

A: 

The first solution that came to my mind was to save the values in the session, issue a redirect without the parameters, and then load the parameters and remove them from the session...

opensas
A: 

the other solution, and the easiest one to implement, is that whenever I read parameters I first read them from the querystring (request.queryString) and then overwerite them from the posted values (request.form)

that way I wouldn't care if the parameters from the querystring keep being sent, the only problem left would be the annoying url...

opensas