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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. can i used 1 page's data of viewstate in another page

can i used 1 page's data of viewstate in another page

Scheduled Pinned Locked Moved ASP.NET
question
12 Posts 5 Posters 1 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.
  • V Offline
    V Offline
    vid nandha
    wrote on last edited by
    #1

    hi all, i have search on net but not satisfied with ans...can anyone tell me that property or data of 1 page's viewstate can be used in another page? Thanx

    R A K 3 Replies Last reply
    0
    • V vid nandha

      hi all, i have search on net but not satisfied with ans...can anyone tell me that property or data of 1 page's viewstate can be used in another page? Thanx

      R Offline
      R Offline
      r a m e s h
      wrote on last edited by
      #2

      ViewState cannot be shared between pages. It is specific to a page. Use Session object to share data between pages.

      V 1 Reply Last reply
      0
      • R r a m e s h

        ViewState cannot be shared between pages. It is specific to a page. Use Session object to share data between pages.

        V Offline
        V Offline
        vid nandha
        wrote on last edited by
        #3

        thanx but some people telling by server.transfer we can share data....i got that kind of ans from many forums.... some are saying no and some are saying yes..........so i m bit confuse on that..........

        P 1 Reply Last reply
        0
        • V vid nandha

          thanx but some people telling by server.transfer we can share data....i got that kind of ans from many forums.... some are saying no and some are saying yes..........so i m bit confuse on that..........

          P Offline
          P Offline
          padmanabhan N
          wrote on last edited by
          #4

          Using Server.Transfer you can not redirect to a different from the server itself. Example if your server is www.yahoo.com you can use server.transfer to move to www.microsoft.com but yes you can move to www.yahoo.com/travels, i.e. within websites. This cross server redirect is possible only using Response.redirect.

          Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]

          1 Reply Last reply
          0
          • V vid nandha

            hi all, i have search on net but not satisfied with ans...can anyone tell me that property or data of 1 page's viewstate can be used in another page? Thanx

            A Offline
            A Offline
            Arindam Sinha
            wrote on last edited by
            #5

            Have you checked this article[^]? Let me know if this helps you or not. :)

            Regards, Arindam Sinha MyBlog - http://arindamsinha.wordpress.com/ Please give your feedback on this answer.

            V 2 Replies Last reply
            0
            • A Arindam Sinha

              Have you checked this article[^]? Let me know if this helps you or not. :)

              Regards, Arindam Sinha MyBlog - http://arindamsinha.wordpress.com/ Please give your feedback on this answer.

              V Offline
              V Offline
              vid nandha
              wrote on last edited by
              #6

              i have checked but i cant understand that article.... i m so confused....my que is can we transfer the data from one page to another using view state... that que asked in my interview but i not getting satisfaction yet bcoz some people saying that it can be possible....

              1 Reply Last reply
              0
              • A Arindam Sinha

                Have you checked this article[^]? Let me know if this helps you or not. :)

                Regards, Arindam Sinha MyBlog - http://arindamsinha.wordpress.com/ Please give your feedback on this answer.

                V Offline
                V Offline
                vid nandha
                wrote on last edited by
                #7

                see this link http://forums.asp.net/t/1137668.aspx[^] by seeing this anyone get confused.........

                P 1 Reply Last reply
                0
                • V vid nandha

                  see this link http://forums.asp.net/t/1137668.aspx[^] by seeing this anyone get confused.........

                  P Offline
                  P Offline
                  padmanabhan N
                  wrote on last edited by
                  #8

                  What the State Management Types?  Client-side state management stores information on the client’s computer by embedding the information into a web page (Hiddenfields), URL (Query strings) or a cookie. 1. View state. 2. Control state: If you create a custom control that requires view state to work, you should use control state to ensure (يضمن) other developers don’t break your control by disabling view state. 3. Hiddenfields: hidden fields store in HTML form without displaying it in the user’s browser. 4. Cookies: cookies store a value in the user’s browser. 5. Query strings: query string stores values in URL.  Server-side state management stores information on server’s memory. 1. Application state. 2. Session state. 3. Profile Properties. 4. Cache state. What the disadvantages are of ViewState? - Disadvantages of ViewState: 1. The more controls you have on the form the larger the size of ViewState and the larger the size of the HTML you send back and forth to the server. 2. Only works when pages postback to themselves. 3. You can't persist (تحفظ) data to other pages.

                  Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]

                  V 1 Reply Last reply
                  0
                  • P padmanabhan N

                    What the State Management Types?  Client-side state management stores information on the client’s computer by embedding the information into a web page (Hiddenfields), URL (Query strings) or a cookie. 1. View state. 2. Control state: If you create a custom control that requires view state to work, you should use control state to ensure (يضمن) other developers don’t break your control by disabling view state. 3. Hiddenfields: hidden fields store in HTML form without displaying it in the user’s browser. 4. Cookies: cookies store a value in the user’s browser. 5. Query strings: query string stores values in URL.  Server-side state management stores information on server’s memory. 1. Application state. 2. Session state. 3. Profile Properties. 4. Cache state. What the disadvantages are of ViewState? - Disadvantages of ViewState: 1. The more controls you have on the form the larger the size of ViewState and the larger the size of the HTML you send back and forth to the server. 2. Only works when pages postback to themselves. 3. You can't persist (تحفظ) data to other pages.

                    Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]

                    V Offline
                    V Offline
                    vid nandha
                    wrote on last edited by
                    #9

                    thanx.........have u seen that link of asp.net forums which i have posted here,in that with examples they have explaine it can be possible so confused n asking....... whats your opinion on that discussion........all that ans were wrong on that?

                    P A 2 Replies Last reply
                    0
                    • V vid nandha

                      thanx.........have u seen that link of asp.net forums which i have posted here,in that with examples they have explaine it can be possible so confused n asking....... whats your opinion on that discussion........all that ans were wrong on that?

                      P Offline
                      P Offline
                      padmanabhan N
                      wrote on last edited by
                      #10

                      actually i am too preparing for interview... in my preparing and experience i have never heard that the viewstate can be transfered from one page to another......

                      Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]

                      1 Reply Last reply
                      0
                      • V vid nandha

                        hi all, i have search on net but not satisfied with ans...can anyone tell me that property or data of 1 page's viewstate can be used in another page? Thanx

                        K Offline
                        K Offline
                        keyur satyadev
                        wrote on last edited by
                        #11

                        no. thats specific answer. as per your question specification, answer is no. u can not use viewstate data in other page. so don't go for any forum or other. hope thats fine.

                        Regards Keyur Satyadev

                        1 Reply Last reply
                        0
                        • V vid nandha

                          thanx.........have u seen that link of asp.net forums which i have posted here,in that with examples they have explaine it can be possible so confused n asking....... whats your opinion on that discussion........all that ans were wrong on that?

                          A Offline
                          A Offline
                          Arindam Sinha
                          wrote on last edited by
                          #12

                          vid nandha wrote:

                          whats your opinion on that discussion

                          The opinion is very simple - viewstate is page specific. This should be enough to remove your confusion. Now you mentioned that Server.Transfer with respect to this topic. 1. Server.Trasfer allows you access the instance of the source page. Using that you can access any property defined in that. It's not about accessing the ViewState, it's about accessing the reference of the source page. 2. In practice, a class hides the members which other class can not access. There should be some interfaces (methods) which would allow other classes to interact with the members. Now suppose you have all public properties then what's use of wrapping them. The same thing is applicable here.If you can access the source page's instance in the target page (while Server.Transfer),you can access everything of that page (if you wish) not only the ViewState. As a practice, you can not access ViewState of any page from other page.

                          Regards, Arindam Sinha MyBlog - http://arindamsinha.wordpress.com/ Please give your feedback on this answer.

                          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