views:

95

answers:

2

hi,

i have two pages: 1) web control(ascx page) and 2) web page(aspx page without master page). Now i calculate some values on page2 through google api through Javascript on render, and i need to transfer these values to page 1 in a hidden field through code. please help

Khushi

A: 

One way (of many):

  • On the Client side: Fill the hidden field, submit the form (with js)
  • Code Behind Page 2: Collect the data in the code behind, Populate the session, Response.Redirect to page 1

Another:

  • Without using the the hidden field, you could just append the calculation result to the query string. (/page.aspx?myResult=xy)
Robert
A: 

Obvious, quick answer: use querystring or Session object.

StupidDeveloper