0

Hi,

I have been trying to transfer some data from one page to another but nothing seems to work. Data is not being passed to the next page. Can anyone tell me a reason why this could happen?

5
Contributors
4
Replies
5
Views
10 Years
Discussion Span
Last Post by Sals
0

If you are using the .net framework 2.0 or greater, you may want to look at the PreviousPage property of the Page object.

For example, let's say you have a hidden field in your original page named hfTheHiddenField and want its value when you get the target page. You can do something like this...

Control ctrl;
string theString;
ctrl = PreviousPage.FindControl("hfTheHiddenField");
if(ctrl != null) {
  //cast it and get it's string value.
  theString.Value = ((HiddenField)ctrl).Value.ToString(); 
}

You could also use Server.Transfer or the Request.Response objects to get values from previous pages as well.

0

or use a session variable ?

Session("session_name") = DATA

then get it back wherever you wish by using

Session("session_name").value()

then free up memory and

Session.remove("session_name")

(SYNTAX VB.NET)

0

Hi,

I have been trying to transfer some data from one page to another but nothing seems to work. Data is not being passed to the next page. Can anyone tell me a reason why this could happen?

HI
u can use querystring,session,hidden field ,cookies...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.