Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Is it possible to send data between aspx pages?

 

eg. page one has variable student_id

 

i need to send this to page two to display it.

 

any ideas?

without time nothing ever ends
Posted

There are several methods, but I recommend these 3 methods, depend on what is your situation:

 

1. use "querystring", value pass thought URL

2. use "cookies", value save in client machine, cookies enabled is require

3. use "session", need extra server memory and default timeout 20 minutes

Posted

i am familiar with all of these.

 

the server one is out of the question, as server variables are not allowed.

 

the cookie one does depend on cookies being enabled as you said, so there is an element of trust that the user has got the cookies enabled.

 

the last seems the best bet. BUT...

 

how does this work exactly? you can send it two ways, one by putting data in the addess bar, and the other by passing it to the new page 'under cover'.

 

where do i set this. am i correct in thinking that this is set in the form detail in the html

 

with action = 'blah.aspx'?

without time nothing ever ends
Posted

1. "Server one is out of the question, as server variables are not allowed"? Session allow you to keep your values in IIS server, it works similar to your "server variable"

 

2. to use Querystring, you can use "blah.aspx?var1=ABC&var2=DEF"

Posted
1. "Server one is out of the question, as server variables are not allowed"? Session allow you to keep your values in IIS server, it works similar to your "server variable"

 

2. to use Querystring, you can use "blah.aspx?var1=ABC&var2=DEF"

 

ok.

session variables are forbidden on the web server that i connect to, they just dont allow them so i am not able to go down that route.

 

i want to use 2. But i have a question / issue.

 

When i have created the asp normal pages i have been able to send information between asp pages.

 

since i am now using asp.net asp pages aka aspx extensions i can not get a button on the form that will submit the information on the page so that a new aspx page can pick it up. when i hit the submit button i keep gettin the original page appear.

 

where do i tell the button / web page that it needs to open the next aspx page when the information is submitted?

 

thanks for you help so far, keep it coming...

 

papa_k

without time nothing ever ends
Posted
How do you jump from first page to second page?

 

this is the problem. I dont know how to do this.

 

when i have used bog standard asp before i have not had this problem.

 

i set the html to look like this...

 

<form method='post' action='nextpage.asp'>

'loads of form stuff

</form>

 

then i have my form submit button. when this is pressed it picks up what the action is set to at the top of the form and then opens that page. in the example above it would be nextpage.asp. then within the nextpage.asp i call

 

request("whateverineed")

 

when i want to display data from the previous page.

 

i do not know how to do this in asp.net. i think that i have set up the above method in my aspx page but it does not work.

 

when i click, what should be the HTML form SUBMIT command it does not call the next aspx page.

 

i have set something up wrong. does anyone have an example they can post?

 

what do you do to carry out the task i have described?

without time nothing ever ends
Posted

I not quite understand your case, I will suggest you simplify your source and post it here, then we guide you straight....

 

If there is submit button in your first page to second page, then you will simply use a 'hidden textbox' to store your value, so when jump to second page, you can use Request.Form("textbox_name") to get your value

Posted

a simple version of what i am after

 

how do i set up the following in asp.net

 

i want textbox1 on page1.aspx

 

i want the user to enter information into page1.aspx and then press submit.

 

this is the simple example of what i want to happen / the submit to do...

 

if textbox1 is blank then

stay on page1.aspx

highlight textbox1

else

open page2.aspx

write what was typed into textbox1 onto page2.aspx

endif

 

now how do i carry this out.

 

the problem i have at the moment is that i DO NOT HAVE A SUBMIT button that works.

 

I can not create a submit button that will open the page2.aspx so that i can then write to the page2.aspx.

 

all submit bottons that i have created so far just reload page1.aspx.

without time nothing ever ends
Posted
in the buttons click event you can use response.redirect(url) or server.transfer(url) to go to another page

 

ok.

 

how do i then access the value that was stored in the page1.aspx and write it to the screen?

without time nothing ever ends
Posted

ok. that method sounds good.

 

would it be possible to send the information via the ASP POST type method rather than the GET type method.

 

Papa

without time nothing ever ends
Posted

ignore that last question.

 

i have decided that by using frames i can achieve the 'hidden' data send.

 

sorry if i appeared slow with the pick up.

 

this is closed

 

thanks for all your help.

 

Papa

 

***** CLOSED *****

without time nothing ever ends
Posted
In this case it's preferable to use Server.Transfer() rather than Response.Redirect().

 

i assumes there is a technical difference as i have just coded the one suggested and it works fine, if not the same at the other one.

without time nothing ever ends
  • 3 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...