Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form.Submit from aspx

Status
Not open for further replies.

NoCoolHandle

Programmer
Apr 10, 2003
2,321
US
I am not sure how to ask this question, but in the old days of asp, if I wanted to bring up a page from the current one, and pass it variables, I could pick post or get. “Get” sending the parameters back as a querystring, “post” in the form collection.

“Form” being kind of private, where as “querystring” having all your parameters publicly viewable in the url.

In Aspx, we tend to post back to the same form.... (but a server side form, not a client side one) and then redirect to a new aspx page based on user input.

What I need to do, is to take a series of variables with the request to the new web page for processing, but not display them in the browser... Any suggestions as to an approach??

Thanks in advance.

Rob

PS I don't want to use the response.redirect abc.aspx?value=x type syntax if at all possible.


 
The session object.

Session("MyVariable") = SomeOject

This was available in classic ASP

Yep - I agree with you - MS should have provided an easier way to use POST data.

Mark [openup]
 
Mark,

Thanks, now I feel really stupid!! That option should have been instantly obvious, but my single mindedness on posting data back stopped me from thinking outside the box I had build for myself.

A follow up question....
If you use session variables for this purpose, do you explicitly destroy them when you have used them? I would imagine that you could suck up server resources like they are going out of fashion if you have many pages/users that need to use this type of "post back".


Rob
 
Yeah - session variables are problematic for many reasons. You can end up getting confused if you use the same session variable between different pages. This is another good reason to destroy them when you are finished with them.

Session("MyVariable") = nothing.

They also rely on either cookies being enabled or session ID "munging" in the url.

Finally, with asp.net, they are kept by default in the asp.net worker process, and this causes problems if this process is recycled. A better option may be to start the asp.net state service and change the web.config file to keep the session variables there.

See thread855-545512

Finally, if you do figure out how to use the POST method, let us know!

Mark

Mark [openup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top