Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Is it possible to get the value of previous page view state value in current page?

Is it possible to get the value of previous page view state value in current page?

Scheduled Pinned Locked Moved ASP.NET
question
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lijo Rajan
    wrote on last edited by
    #1

    Hi all, Can u tell me Is it possible to get the value of previous page view state value in current page? eg page1 viewstate["Name"]="Akash" response.redirect("page2.aspx") so in Page2 how can i get the value of viewstate["Name"]? is it possible? if so how? Thanks and Regards Lijo

    C C 2 Replies Last reply
    0
    • L Lijo Rajan

      Hi all, Can u tell me Is it possible to get the value of previous page view state value in current page? eg page1 viewstate["Name"]="Akash" response.redirect("page2.aspx") so in Page2 how can i get the value of viewstate["Name"]? is it possible? if so how? Thanks and Regards Lijo

      C Offline
      C Offline
      Coding C
      wrote on last edited by
      #2

      Hi, ViewState is limited to postbacks for single page only. You can not access value of viewstate of one page from another. Use session instead. HTH.

      Coding C# www.excitetemplate.com

      1 Reply Last reply
      0
      • L Lijo Rajan

        Hi all, Can u tell me Is it possible to get the value of previous page view state value in current page? eg page1 viewstate["Name"]="Akash" response.redirect("page2.aspx") so in Page2 how can i get the value of viewstate["Name"]? is it possible? if so how? Thanks and Regards Lijo

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        You might start by reading a basic book, so you have some sort of clue about what you're doing. You have two options: 1 - you can do a cross page postback, where page 1 sets up page 2 to see it's viewstate. This is an ugly hack 2 - you can take your two pages, turn them into controls, show them on the same page, and then they will share viewstate b/c they are the same page.

        Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups