Submitting a form

G

Griff

I've inherited an ASP application that currently builds up a URL with a
series of keys and values (http://url?key=value&key=value&key=value).

Having built this up programmatically, it then does a Response.Redirect
command.

The problem I have is that I need to add a new key and value to this, but
the existing URL is so long that it almost breaks the limit for the length
of a URL. So, as soon as I add on my new key-value it breaks.

I wondered about shortening the names, but on inspection it appears that my
predecessor has already gone down that path.

What I therefore want to do is to create a form with hidden text fields and
make the form POST the data.

Within the ASP code, it's fairly trivial to build up this form in the same
way that the URL was built up.

However, I now need to SUBMIT this form from my ASP page (running on IIS).

What would be the equivalent of the Response.Redirect command that will now
submit my form?

Or...is there an even better way to go about this....?

Griff
 
B

Bob Barrows [MVP]

Griff said:
I've inherited an ASP application that currently builds up a URL with
a series of keys and values
(http://url?key=value&key=value&key=value).

Having built this up programmatically, it then does a
Response.Redirect command.

The problem I have is that I need to add a new key and value to this,
but the existing URL is so long that it almost breaks the limit for
the length of a URL. So, as soon as I add on my new key-value it
breaks.

I wondered about shortening the names, but on inspection it appears
that my predecessor has already gone down that path.

What I therefore want to do is to create a form with hidden text
fields and make the form POST the data.

Within the ASP code, it's fairly trivial to build up this form in the
same way that the URL was built up.

However, I now need to SUBMIT this form from my ASP page (running on
IIS).

What would be the equivalent of the Response.Redirect command that
will now submit my form?

Or...is there an even better way to go about this....?

Griff


A couple options (there are more):

1. Use client-side code to submit the form in the onload event - follow up
in a client-side scripting newsgroup such as .scripting.jscript for
assistance with this approach
2. Use ServerXMLHTTP to submit your data to the other page and retrieve the
results. - http://www.aspfaq.com/show.asp?id=2173

Bob Barrows
 
G

Griff

Bob

The JavaScript option seems most suitable in this instance as it doesn't
come back.

So, I'll use the onLoad() event in the body to call some javascript to
submit the form.

Thanks!

Griff
 
A

Adrienne

Bob

The JavaScript option seems most suitable in this instance as it doesn't
come back.

So, I'll use the onLoad() event in the body to call some javascript to
submit the form.

Thanks!

Griff

Be aware that you are going to have to provide a non-javascript alternative
for users who do not have javascript enabled.
 

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,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top