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?

Recommended Answers

All 4 Replies

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.

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)

Can an array of structures be passed?

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...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.