-2

I have a web application with 10 pages. Page1.aspx, page2.aspx......page10.aspx. I have a button on Page2.aspx page. When I will click that button, an object will transfer from Page2.aspx to page4.aspx, page7.aspx and Page10.aspx. I cannot use session state. How do I pass an object from page2 to page4 and so on?

PeteH
  • 2,394
  • 1
  • 20
  • 29
San20130121
  • 11
  • 2
  • 6
  • 2
    "I can not use session," - please put a little effort into explaining why? Maybe other solutions are also ruled out? Or maybe, you can't use session, per *your* understanding of it, but it is in fact a feasible approach. – Damien_The_Unbeliever May 13 '13 at 12:07
  • Hi, Yes, I know but i faced this question in a client interview phase. I told them we will go for Session, but they ask me there is another way that we can pass object from one page to another what is that??? – San20130121 May 13 '13 at 12:11

2 Answers2

0

If your site must be stateless you can pass data from page to page through form elements.

There are various choices within this - you could serialize the object and pass it as a single form variable, or you could pass each of the object's properties as a form variable, and so on...

PeteH
  • 2,394
  • 1
  • 20
  • 29
0

You can also use context object. Before you use this you need to check the lifecycle of context object.

Context.Items clears during page refresh/transfer

Community
  • 1
  • 1
Amit
  • 882
  • 6
  • 13