Results 1 to 3 of 3

Thread: Can you get properties of controls on one ASP.NET page from another page?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2001
    Posts
    122

    Question Can you get properties of controls on one ASP.NET page from another page?

    Assuming both pages are within the same ASP.NET application, is there a way to access properties of controls on one page from another? For example, I am on page 1 and need to see if a checkbox on page 2 is checked.

  2. #2
    Member Ooogaleee's Avatar
    Join Date
    Nov 2002
    Location
    Jacksonville, FL
    Posts
    52
    I would probably set a session variable to before leaving the first one, and use that value to make your decisions on the second page. Like this maybe....

    In FirstPage.aspx:
    If Checkbox1.checked=True Then
    Session("test")="true"
    else
    Session("test")="false"
    End If


    In SecondPage.aspx:
    If Session("test")="true" Then
    ' do stuff
    else
    ' do other stuff
    End If



    maybe?.....

    Ooogs

  3. #3
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Im not at my development box right now, but you can accomplish this by using the context object (may be named a little differently). I'll post code later..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width