Passing Form data to another page
-
Hi, I have a page with some info on it, including a customer details form. When the user clicks the submit button, they are redirected to a second page* (using the button postbackurl property). On this new page i wish to recall the data the user input into the form. I know that i should use 'Requet.Form["field name"]', for this but i dont know what the field will be called. At present iam using this:
Literal1.Text = Request.Form["TextBox2"];
However this is not returning any text. Please can you sgive me some idea of where im going wrong. Many Many Thanks! *I have to do this so please dont suggest i do it differently. Thanks. -
Hi, I have a page with some info on it, including a customer details form. When the user clicks the submit button, they are redirected to a second page* (using the button postbackurl property). On this new page i wish to recall the data the user input into the form. I know that i should use 'Requet.Form["field name"]', for this but i dont know what the field will be called. At present iam using this:
Literal1.Text = Request.Form["TextBox2"];
However this is not returning any text. Please can you sgive me some idea of where im going wrong. Many Many Thanks! *I have to do this so please dont suggest i do it differently. Thanks.Find any info on ViewState or Session objects
-
Find any info on ViewState or Session objects
-
Hi, I have a page with some info on it, including a customer details form. When the user clicks the submit button, they are redirected to a second page* (using the button postbackurl property). On this new page i wish to recall the data the user input into the form. I know that i should use 'Requet.Form["field name"]', for this but i dont know what the field will be called. At present iam using this:
Literal1.Text = Request.Form["TextBox2"];
However this is not returning any text. Please can you sgive me some idea of where im going wrong. Many Many Thanks! *I have to do this so please dont suggest i do it differently. Thanks. -
Friend ,..You can use 'request.querystring' method to call the second page's value to other ...
I dont really want to use QueryString as its open to abuse. Thanks anyway.
-
I cant really use sessions as i am using them for a whole load of orders etc. Thanks for the suggestion.
-
Find any info on ViewState or Session objects
Care to shed any more light, with reference to my question? Thanks.
-
I cant really use sessions as i am using them for a whole load of orders etc. Thanks for the suggestion.
creat an order object class. fill the class for each order as soon as one order is filled add the order to an ArrayList. In the session object you can objects. So you can add an ArrayList to 1 session0bject. In the second page cast that session object to an ArrayList and you can reach your data.
-
Hi, I have a page with some info on it, including a customer details form. When the user clicks the submit button, they are redirected to a second page* (using the button postbackurl property). On this new page i wish to recall the data the user input into the form. I know that i should use 'Requet.Form["field name"]', for this but i dont know what the field will be called. At present iam using this:
Literal1.Text = Request.Form["TextBox2"];
However this is not returning any text. Please can you sgive me some idea of where im going wrong. Many Many Thanks! *I have to do this so please dont suggest i do it differently. Thanks.Hi dear, Have u tried using Server.Transfer and HttpContext just see the below exa. there is one textbox in yr form and u want that textbox value in another page. for that do the following..
HttpContext.Current.Items("txt1") = Txt1.Text; //--- yr form textbox
Server.Transfer("anotherPage.aspx");-------------- To access data in anotherPage.aspx
string txt1 = HttpContext.Current.Items("txt1").toString();
I hope it will help u.. regards
Rana Krishnraj
-
Hi dear, Have u tried using Server.Transfer and HttpContext just see the below exa. there is one textbox in yr form and u want that textbox value in another page. for that do the following..
HttpContext.Current.Items("txt1") = Txt1.Text; //--- yr form textbox
Server.Transfer("anotherPage.aspx");-------------- To access data in anotherPage.aspx
string txt1 = HttpContext.Current.Items("txt1").toString();
I hope it will help u.. regards
Rana Krishnraj
Rana, Thanks for the suggestion. I have 6 textboxes i need cross page access to. Will this work with all 6 textboxes? Also do i need to dispose of the items in Context after use? Thanks!!!
-
Rana, Thanks for the suggestion. I have 6 textboxes i need cross page access to. Will this work with all 6 textboxes? Also do i need to dispose of the items in Context after use? Thanks!!!
-
creat an order object class. fill the class for each order as soon as one order is filled add the order to an ArrayList. In the session object you can objects. So you can add an ArrayList to 1 session0bject. In the second page cast that session object to an ArrayList and you can reach your data.
This is a great tip for something else I was working on. Thanks for posting it digimanus.
digimanus wrote:
creat an order object class. fill the class for each order as soon as one order is filled add the order to an ArrayList. In the session object you can objects. So you can add an ArrayList to 1 session0bject. In the second page cast that session object to an ArrayList and you can reach your data.