Accessing the value of a page to another page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gracepaul
    New Member
    • Jul 2008
    • 28

    Accessing the value of a page to another page

    hi

    How can i access the value of a text box in Page1.aspx to Page2.aspx by using a javascript in the onload event of the Page2.aspx . Without using session variables i want to access the va;ues in a page to another page.

    Please reply soon
    Thanks in advance
    Grace
  • shweta123
    Recognized Expert Contributor
    • Nov 2006
    • 692

    #2
    Hi,

    You can access the controls from one page to another when you submit the that page.


    If you want to access the value of textbox in Page1.aspx into Page2.aspx
    using javascript then use Form object and its Elements property.

    e.g.
    You can write it using one of the following methods:

    i> document.myform .Textbox1 //where myform and Textbox1 are names of your form/element.

    ii> document.myform .elements[i] //where i is the position of the Textbox1 field within form

    Comment

    Working...