lost all of data after postback....

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Re: lost all of data after postback....

    Since the rows are added manually at runtime, you must keep track of the
    rows and add them back again each postback.
    You might use a DataSet to help with this.
    Viewstate is also a useful tool for such things.

    --
    I hope this helps,
    Steve C. Orr, MCSD
    [url]http://Steve.Orr.net[/url]


    "Jongmin" <aplaxas@hotmail.com> wrote in message
    news:046f01c34b20$7dee1ee0$a401280a@phx.gbl...
    >
    > Hi !!!
    >
    > I have three WebControls.
    > Button:cmdA, Button:cmdB, Table:tblSummary
    >
    > I made tblSummary[System.Web.UI.WebControls.Table] in
    > design time, which has no row.
    >
    > And cmdA modifies the tblSummary, specially adding rows.
    > private void cmdA_Click()
    > {
    > // adds some rows in tblSummary
    > ...
    > tblSummary.Rows.Add(rowBody);
    > }
    >
    > problem takes place when cmdB causes postpack.
    > Even thouhg the cmdB has no code and causes just postback,
    > after postback, tblSummary is cleared....
    >
    > How to keep the tblSummary from being cleared after
    > postback.
    >
    > Thanks,
    > Jongmin
    >
    >
    >
    >
    >
    >
    >

    Steve C. Orr, MCSD Guest

  2. Similar Questions and Discussions

    1. #38921 [NEW]: pdo lost the first row data:with firebird blob data
      From: achun dot shx at gmail dot com Operating system: windows PHP version: 5.1.6 PHP Bug Type: InterBase related Bug...
    2. Dynamically added controls are lost on a Postback
      Hi, i created a custom control overriden from HierarchicalDataBoundControl. In method PerformDataBinding I add some controls (Controls.Add(new...
    3. UserControl values lost on PostBack
      Hi all, I have a very simple user control that contains 3 drop downs. Whenever there's a postback the values of these drop downs are lost. I've...
    4. Dynamic control state changes lost on Postback
      I have been developing a set of custom controls that include several dynamically generated controls inside them (for example, 'SupportTextBox'...
    5. textbox value lost upon postback
      Hi All, I have a server runnable textbox control. I also have a server side button object but I hook up javascript to it to show a modal dialog....
  3. #2

    Default Re: lost all of data after postback....


    I used a dataset to solve this problem.

    Thanks,

    >-----Original Message-----
    >Since the rows are added manually at runtime, you must
    keep track of the
    >rows and add them back again each postback.
    >You might use a DataSet to help with this.
    >Viewstate is also a useful tool for such things.
    >
    >--
    >I hope this helps,
    >Steve C. Orr, MCSD
    >[url]http://Steve.Orr.net[/url]
    >
    >
    >"Jongmin" <aplaxas@hotmail.com> wrote in message
    >news:046f01c34b20$7dee1ee0$a401280a@phx.gbl...
    >>
    >> Hi !!!
    >>
    >> I have three WebControls.
    >> Button:cmdA, Button:cmdB, Table:tblSummary
    >>
    >> I made tblSummary[System.Web.UI.WebControls.Table] in
    >> design time, which has no row.
    >>
    >> And cmdA modifies the tblSummary, specially adding rows.
    >> private void cmdA_Click()
    >> {
    >> // adds some rows in tblSummary
    >> ...
    >> tblSummary.Rows.Add(rowBody);
    >> }
    >>
    >> problem takes place when cmdB causes postpack.
    >> Even thouhg the cmdB has no code and causes just
    postback,
    >> after postback, tblSummary is cleared....
    >>
    >> How to keep the tblSummary from being cleared after
    >> postback.
    >>
    >> Thanks,
    >> Jongmin
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >
    >
    >.
    >
    jongmin Guest

Posting Permissions

  • You may not post new threads
  • You may 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