S
Scott Lyon
I am having a strange problem. The program is a bit complex, but I'll try to
simplify what I can. I apologize if this is complicated, but I think this
would still be simpler than posting a bunch of source code. If you want me
to post code, though, just say so.
In a nutshell, I've got an ASP.NET application that has one main ASPX page.
On that ASPX page, it has a user control (an ASCX) that displays the actual
data and controls I need.
On that user control, I have a drop-down list, and an asp:repeater tag that
contains an asp:label tag that contains:
<%# DataBinder.Eval(Container.DataItem, "DESC") %> as the Text= field
That asp:repeater also contains an asp:imagebutton that is a "Delete"
button.
Basically, when the user makes a selection from the drop-down list, a stored
procedure is called, and that data populates the asp:repeater (adding an
entry for each row retrieved by the stored procedure).
This part works fine.
The way it's set up, if the user clicks the "Delete" button after this has
been populated, it removes that entry from the database (which works
correctly), and then calls the code again to repopulate the repeater.
I've confirmed that this seems to work (the row does get deleted, and when
the stored procedure is called, it returns the proper rows, without the
"deleted" entry). But it does not appear to be refreshing the repeater. The
repeater (in some cases) remains with the additional row still showing, and
in other cases, blanks out entirely.
The code I use to populate is a function that calls the stored procedure,
and returns it in a DataTable. Then that DataTable is set up as the
DataSource of the repeater, and then does a .DataBind on it as well.
What am I missing? It seems to me that I need to force a refresh or postback
or something. But I'm at a loss to figure out how to do that.
Can anyone help?
Thanks!
simplify what I can. I apologize if this is complicated, but I think this
would still be simpler than posting a bunch of source code. If you want me
to post code, though, just say so.
In a nutshell, I've got an ASP.NET application that has one main ASPX page.
On that ASPX page, it has a user control (an ASCX) that displays the actual
data and controls I need.
On that user control, I have a drop-down list, and an asp:repeater tag that
contains an asp:label tag that contains:
<%# DataBinder.Eval(Container.DataItem, "DESC") %> as the Text= field
That asp:repeater also contains an asp:imagebutton that is a "Delete"
button.
Basically, when the user makes a selection from the drop-down list, a stored
procedure is called, and that data populates the asp:repeater (adding an
entry for each row retrieved by the stored procedure).
This part works fine.
The way it's set up, if the user clicks the "Delete" button after this has
been populated, it removes that entry from the database (which works
correctly), and then calls the code again to repopulate the repeater.
I've confirmed that this seems to work (the row does get deleted, and when
the stored procedure is called, it returns the proper rows, without the
"deleted" entry). But it does not appear to be refreshing the repeater. The
repeater (in some cases) remains with the additional row still showing, and
in other cases, blanks out entirely.
The code I use to populate is a function that calls the stored procedure,
and returns it in a DataTable. Then that DataTable is set up as the
DataSource of the repeater, and then does a .DataBind on it as well.
What am I missing? It seems to me that I need to force a refresh or postback
or something. But I'm at a loss to figure out how to do that.
Can anyone help?
Thanks!