Professional Web Applications Themes

why does my control retain its value after postback - ASP.NET Building Controls

i am not implementing any state mechanisms or IPostBackEventHandler in my control, but when my asp.net page accesses the control, the data that was there from the last time i loaded the control on the previous page load, is still there. Is the page handing the control's state or what? thanks...

  1. #1

    Default why does my control retain its value after postback

    i am not implementing any state mechanisms or IPostBackEventHandler in my
    control, but when my asp.net page accesses the control, the data that was
    there from the last time i loaded the control on the previous page load, is
    still there.

    Is the page handing the control's state or what?

    thanks


    TS Guest

  2. #2

    Default RE: why does my control retain its value after postback

    Hi TS,

    Thanks for your posting. I've also found your other posts regarding on
    creating custom webcontrol in the asp.net and sub groups. For the question
    you mentioned here, is the control you mentioned also a composite control
    which just create some other buildin asp.net controls and add them into the
    composite control's Controls collection?

    If so, since the buildin existing ASP.NET controls are all well implemented
    which has the correctly method to help store and retain the
    states/properties between postback, so if we just add those controls as sub
    controls in composite control, we don't need to manually do the states
    maintain task. In fact, for those interfaces such as
    "IPostBackEventHandler" or "IPostBackDataHandler", generally they're only
    used for very basic controls from scratch.

    Thanks,

    Steven Cheng
    Microsoft Online Support

    Get Secure! [url]www.microsoft.com/security[/url]
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)



    --------------------
    | From: "TS" <manofsteele1nospam.nospam>
    | Subject: why does my control retain its value after postback
    | Date: Tue, 2 Aug 2005 08:42:05 -0500
    | Lines: 10
    | X-Priority: 3
    | X-MSMail-Priority: Normal
    | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
    | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
    | Message-ID: <OrF65f2lFHA.2380TK2MSFTNGP10.phx.gbl>
    | Newsgroups: microsoft.public.dotnet.framework.aspnet.buildingc ontrols
    | NNTP-Posting-Host: 103nat100.tea.state.tx.us 198.214.103.100
    | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP10.phx.gbl
    | Xref: TK2MSFTNGXA01.phx.gbl
    microsoft.public.dotnet.framework.aspnet.buildingc ontrols:3968
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.buildingc ontrols
    |
    | i am not implementing any state mechanisms or IPostBackEventHandler in my
    | control, but when my asp.net page accesses the control, the data that was
    | there from the last time i loaded the control on the previous page load,
    is
    | still there.
    |
    | Is the page handing the control's state or what?
    |
    | thanks
    |
    |
    |

    Steven Cheng[MSFT] Guest

Similar Threads

  1. control id and name for postback mechanism
    By Martin in forum ASP.NET Building Controls
    Replies: 1
    Last Post: August 20th, 08:55 AM
  2. get control properties after postback
    By mr. App in forum ASP.NET Building Controls
    Replies: 2
    Last Post: May 16th, 08:16 AM
  3. help with postback-less calendar control.
    By Ramakant in forum ASP.NET Building Controls
    Replies: 4
    Last Post: May 19th, 06:50 AM
  4. Can't retain state for Control inherted from ListBox
    By Don in forum ASP.NET Building Controls
    Replies: 1
    Last Post: April 26th, 05:45 PM
  5. control not found on postback
    By Igor Belagorudsky in forum ASP.NET General
    Replies: 3
    Last Post: July 29th, 04:05 AM

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