Forum Moderators: open

Message Too Old, No Replies

Sending variables to a asp.net page.

Sending variables to a asp.net page.

         

mavrick

7:18 am on Nov 29, 2004 (gmt 0)

10+ Year Member



hi

I am trying to send variables through to a .aspx page. Trying not to use Session, Query String or hidden fields.

Trying to work with the submit button.

Basically I am trying to send info to another page with out using the above methods...

is this possible or not.... I am sure it can be done...But not sure how

Thanks…

txbakers

4:40 pm on Nov 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



where are you getting the data from? The only two alternatives to the ones your mentioned are:

POST and from a Database.

POST would involve sending hidden fields if the user doesn't enter them.

Although, you can call a "transient" page which then submits the hidden data.

mattglet

5:17 pm on Nov 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You cannot POST variables from one ASPX page to another ASPX page without a 3rd party component.

Do a search for topics regarding the POSTBACK feature of .NET.

beauzero

4:59 pm on Dec 3, 2004 (gmt 0)

10+ Year Member



Is the input coming from web side or server side?

raywood

5:53 pm on Dec 4, 2004 (gmt 0)

10+ Year Member



mavrick.
First, a submit button on an aspx page will always do a postback to itself. I've done what you describe in a couple of ways.

You could use the context variable.

One thing I have done is create a public class in a separate module with public variables in it. Clicking a button on the first form ( not a submit button, just a plain button with events) writes a value to the variable in the other module. The second page or any other module can then read it.

I have used this idea to lock access to variables and databases when running asynchronous threads that all want to have a look at a dynamic value.