Professional Web Applications Themes

Viewstate, how to stop from being sent to client when storing at server? - ASP.NET General

Maybe turn viewstate on while working with it at the server and off again before the page is sent to the client? Page.EnableViewState = True | False Sincerely, -- S. Justin Gengo, MCP Web Developer Free code library at: www.aboutfortunate.com "Out of chaos comes order." Nietzche "JCardinal" <com> wrote in message news:phx.gbl...  around  and  viewState )  so  might ...

  1. #1

    Default Re: Viewstate, how to stop from being sent to client when storing at server?

    Maybe turn viewstate on while working with it at the server and off again
    before the page is sent to the client?

    Page.EnableViewState = True | False

    Sincerely,

    --
    S. Justin Gengo, MCP
    Web Developer

    Free code library at:
    www.aboutfortunate.com

    "Out of chaos comes order."
    Nietzche


    "JCardinal" <com> wrote in message
    news:phx.gbl... 
    around 
    and 
    viewState ) 
    so 
    might 


    S. Guest

  2. #2

    Default Re: Viewstate, how to stop from being sent to client when storing at server?

    Don't call base class's method in the SavePageStateToPersistenceMedium as it
    will register the field and persist it with state data. However, you need to
    still register the hidden field for this to work, but no need to send data
    over the wire (bug in ASP.NEt v1 demands hidden filed __VIEWSTATE to be
    present even if viewState is stored elsewhere)

    Check this for details:
    http://www.aspalliance.com/PaulWilson/Articles/?id=7

    --
    Teemu Keiski
    MCP, Designer/Developer
    Mansoft tietotekniikka Oy
    http://www.mansoft.fi

    AspInsiders Member, www.aspinsiders.com
    ASP.NET Forums Moderator, www.asp.net
    AspAlliance Columnist, www.aspalliance.com




    "JCardinal" <com> wrote in message
    news:phx.gbl... 
    around 
    and 
    viewState ) 
    so 
    might 


    Teemu Guest

  3. #3

    Default Re: Viewstate, how to stop from being sent to client when storing at server?

    What do you mean by need to register the hidden field for this to work
    please give an example
    Thank you

    "Teemu Keiski" <com> wrote in message
    news:uiqIrO%phx.gbl... 
    it 
    to 
    > around 
    > and 
    > viewState ) [/ref]
    one 
    > might 
    >
    >[/ref]


    MS Guest

  4. #4

    Default Re: Viewstate, how to stop from being sent to client when storing at server?

    Aha! Perfect, thank you Teemu!
    That should have been obvious now that I think about it.

    For the record (for any others searching for this), here are the two
    functions I'm using that now save viewstate on the server and don't send the
    viewstate data to the client:

    protected override void SavePageStateToPersistenceMedium( object viewState )
    {
    //Save viewstate data in session variable on server
    Session["VIEWSTATE"] = viewState;
    //keep the viewstate hidden variable sent to the client but with no data to
    avoid error
    RegisterHiddenField("__VIEWSTATE", "");
    }

    protected override object LoadPageStateFromPersistenceMedium()
    {
    //load back viewstate from session variable at server
    return Session["VIEWSTATE"];
    }

    =-=-=-=-

    "Teemu Keiski" <com> wrote in message
    news:uiqIrO%phx.gbl... 
    it 
    to 
    > around 
    > and 
    > viewState ) [/ref]
    one 
    > might 
    >
    >[/ref]


    JCardinal Guest

  5. #5

    Default Re: Viewstate, how to stop from being sent to client when storing at server?

    Dear John,

    Thank you for using Microsoft MSDN managed newsgroup.

    I notice the following post in the microsoft.public.dotnet.framework.aspnet
    group.

    Viewstate, how to stop from being sent to client when storing at server?

    Thank you very much for this important information. I believe that it will
    be helpful to everybody here.

    Best regards,

    Jacob Yang
    Microsoft Online Partner Support
    <MCSD>
    Get Secure! C www.microsoft.com/security
    This posting is provided "as is" with no warranties and confers no rights.

    Jacob Guest

Similar Threads

  1. Changing viewstate on client
    By Paul K in forum ASP.NET Building Controls
    Replies: 3
    Last Post: October 26th, 03:37 PM
  2. Flash Webcam client <-> client (not client <-> server<-> client)
    By bivald in forum Macromedia Flash Flashcom
    Replies: 0
    Last Post: April 24th, 10:33 PM
  3. storing objects in ViewState
    By D Wicker in forum ASP.NET Building Controls
    Replies: 0
    Last Post: October 28th, 05:41 PM
  4. Storing page information / viewstate between pages
    By Munsifali Rashid in forum ASP.NET General
    Replies: 0
    Last Post: June 27th, 03:51 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139