URL parameters end up in form action

A

Anthony

Here is my problem...

User clicks on http://foo.bar.com/default.aspx?id=12345 and gets a report
about that object. Now at the top of the page there is a text box and a
button, if they want to query another object. The problem is that in the
html....

<form action="http://foo.bar.com/default.aspx?id=12345" .... >

</form>

the parameter is embeded in the URL. Now I understand why that might be
useful in some cases, but in my case its *NOT* useful and *NOT* wanted (as
that ID is no longer of interest to the user and is more or less irrelavant
at this point if they are querying another object). Is there any way to get
rid of that (and any other) parameters from the URL? I know I could write my
code to ignore it if its a postback, but I'd rather write this in a more
elegant fashion.

-Anthony
 
T

Tom.PesterDELETETHISSS

Its not so clean but you can user request.Form("id") to get what has been
posted as opposed to request.QuerySstring("id").

This can be confusing since a bookmarked page will go to the id in the QS
and not what has been posted.

Let me know if you have any more questions..

Cheers,
Tom Pester
 
A

Anthony

This can be confusing since a bookmarked page will go to the id in the QS
and not what has been posted.

Yea thats what I'm trying to avoid. It would be optimal if the page would
"eat" the parameter and it just wouldnt appear anymore (the URL would show
just http://foo.bar.com/default.aspx with no QS).

Thanks for the tip though.

-Anthony
 
T

Tom.PesterDELETETHISSS

Hi Anthony,

I found that MS actually acknowledges it as a problem :

http://support.microsoft.com/default.aspx?scid=kb;en-us;810218

That document also offers a workaround with client side script... :)

This person had the same Q as you:

http://www.devhood.com/messages/message_view-2.aspx?thread_id=94884

Cheers,
Tom Pester

PS

What you also could do is a bit more drastic and catch the server response
just before it is send to the browser and do a regular expression in it.
This way you could solve the prob server side.
 
A

Anthony

Thanks Tom, I figured I was going to have to do something client side, at
least I know MS is aware of it..

-Anthony
 
T

Tom.PesterDELETETHISSS

What you also could do is a bit more drastic and catch the server response
just before it is send to the browser and do a regular expression in it.
This way you could solve the prob server side.

Cheers,
Tom Pester
 

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

No members online now.

Forum statistics

Threads
473,888
Messages
2,569,965
Members
46,294
Latest member
HollieYork

Latest Threads

Top