How to get the previous page value

Using C #,

I want to get the value from the previous page.

For instance,

In a page A i have the textbox value like "apple", i want to get the same value in page B

Code page.

 <a href="javascript:void(0)"
    onclick="window.open('pageB.aspx',
    'Add','width=700,height=400')">
    Add</a>

Above code links page B to page A

How to get the page value. The value of the text field on page B.

Help is needed

+3
source share
3 answers

Why don't you just pass the value as a parameter in your call to open pageB.aspx?

<a href="javascript:void(0)"
    onclick="window.open('pageB.aspx?param=' +
 document.getElementById('textBoxFromPageA').value,
        'Add','width=700,height=400')">
        Add</a>

This will result in a URL pageB.aspx?param=Apple. Then, using pageB.aspx, you can access this value with a call Request("param").

+3
source

Perhaps you can save it in a Session variable?

: http://kb2.adobe.com/cps/165/tn_16563.html

0

As an alternative to a query string or session, consider using the PreviousPage property or using server.transfer, and then get the previous page handle through context.handler.

Doing this useful in this session is not useless, and query string parameters: visible, editable, hacked by the whole world are not used.

0
source

Source: https://habr.com/ru/post/1758178/


All Articles