473,410 Members | 1,908 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,410 software developers and data experts.

asp:repeater not doing a refresh/postback

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!
Nov 17 '05 #1
5 8227
Scott,

When the user clicks on the Delete button, the page will post back and call
the sp to delete the record. Apparently this part worked as you described.
However, after deleting the record, you need create the DataTable again and
bind it to the grid. That will force the repeater to refresh.

L.L.
"Scott Lyon" <scott.lyonNOSPAM_at__NOSPAMrapistan.comNOSPAM> wrote in
message news:OV**************@tk2msftngp13.phx.gbl...
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!

Nov 17 '05 #2
That's exactly what I'm doing.
In the module that does the delete, first it does the database call to
delete the row. Then it does the database call to re-populate the repeater
grid (and put that into the DataTable). Then it sets that DataTable to the
source of the grid, and then binds the data.

In fact, I've even stepped it through the code, and I saw it step right
through each step as expected.
But oddly enough, it still never refreshed the grid on the form.
Thanks!
-Scott

"L. L." <ll**@cyence.com> wrote in message
news:uy**************@TK2MSFTNGP12.phx.gbl...
Scott,

When the user clicks on the Delete button, the page will post back and call the sp to delete the record. Apparently this part worked as you described.
However, after deleting the record, you need create the DataTable again and bind it to the grid. That will force the repeater to refresh.

L.L.
"Scott Lyon" <scott.lyonNOSPAM_at__NOSPAMrapistan.comNOSPAM> wrote in
message news:OV**************@tk2msftngp13.phx.gbl...
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!


Nov 17 '05 #3
What about try the following,
After the row is deleted, close the browser. Double check to make sure the
row is actually deleted in the db. And then open the browser again to view
the page. If the row deleted is still in the data grid, the only thing I can
think of is caching. Maybe the page or user control is being cached.

L.L.

"Scott Lyon" <scott.lyonNOSPAM_at__NOSPAMrapistan.comNOSPAM> wrote in
message news:%2****************@TK2MSFTNGP09.phx.gbl...
That's exactly what I'm doing.
In the module that does the delete, first it does the database call to
delete the row. Then it does the database call to re-populate the repeater
grid (and put that into the DataTable). Then it sets that DataTable to the
source of the grid, and then binds the data.

In fact, I've even stepped it through the code, and I saw it step right
through each step as expected.
But oddly enough, it still never refreshed the grid on the form.
Thanks!
-Scott

"L. L." <ll**@cyence.com> wrote in message
news:uy**************@TK2MSFTNGP12.phx.gbl...
Scott,

When the user clicks on the Delete button, the page will post back and call
the sp to delete the record. Apparently this part worked as you described.
However, after deleting the record, you need create the DataTable again

and
bind it to the grid. That will force the repeater to refresh.

L.L.
"Scott Lyon" <scott.lyonNOSPAM_at__NOSPAMrapistan.comNOSPAM> wrote in
message news:OV**************@tk2msftngp13.phx.gbl...
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!



Nov 17 '05 #4
I have been able to confirm that the delete is actually happening on the
database. In fact, if I make another selection from the drop-down list (with
autopostback enabled), and then switch back to the original selection, it
shows exactly what it should (all the rows there previously, except for the
one deleted is gone).
Is there a way I can either force the postback (in ASP.NET), or somehow
prevent it from being cached in that way?
Thanks!
-Scott

"L. L." <ll**@cyence.com> wrote in message
news:uk**************@TK2MSFTNGP09.phx.gbl...
What about try the following,
After the row is deleted, close the browser. Double check to make sure the
row is actually deleted in the db. And then open the browser again to view
the page. If the row deleted is still in the data grid, the only thing I can think of is caching. Maybe the page or user control is being cached.

L.L.

"Scott Lyon" <scott.lyonNOSPAM_at__NOSPAMrapistan.comNOSPAM> wrote in
message news:%2****************@TK2MSFTNGP09.phx.gbl...
That's exactly what I'm doing.
In the module that does the delete, first it does the database call to
delete the row. Then it does the database call to re-populate the repeater
grid (and put that into the DataTable). Then it sets that DataTable to the source of the grid, and then binds the data.

In fact, I've even stepped it through the code, and I saw it step right
through each step as expected.
But oddly enough, it still never refreshed the grid on the form.
Thanks!
-Scott

"L. L." <ll**@cyence.com> wrote in message
news:uy**************@TK2MSFTNGP12.phx.gbl...
Scott,

When the user clicks on the Delete button, the page will post back and call
the sp to delete the record. Apparently this part worked as you described. However, after deleting the record, you need create the DataTable again and
bind it to the grid. That will force the repeater to refresh.

L.L.
"Scott Lyon" <scott.lyonNOSPAM_at__NOSPAMrapistan.comNOSPAM> wrote in
message news:OV**************@tk2msftngp13.phx.gbl...
> 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!
>
>



Nov 17 '05 #5
The problem must be in the code. Can you post all your code?

L.L.
"Scott Lyon" <scott.lyonNOSPAM_at__NOSPAMrapistan.comNOSPAM> wrote in
message news:ut****************@tk2msftngp13.phx.gbl...
I have been able to confirm that the delete is actually happening on the
database. In fact, if I make another selection from the drop-down list (with autopostback enabled), and then switch back to the original selection, it
shows exactly what it should (all the rows there previously, except for the one deleted is gone).
Is there a way I can either force the postback (in ASP.NET), or somehow
prevent it from being cached in that way?
Thanks!
-Scott

"L. L." <ll**@cyence.com> wrote in message
news:uk**************@TK2MSFTNGP09.phx.gbl...
What about try the following,
After the row is deleted, close the browser. Double check to make sure the
row is actually deleted in the db. And then open the browser again to view the page. If the row deleted is still in the data grid, the only thing I can
think of is caching. Maybe the page or user control is being cached.

L.L.

"Scott Lyon" <scott.lyonNOSPAM_at__NOSPAMrapistan.comNOSPAM> wrote in
message news:%2****************@TK2MSFTNGP09.phx.gbl...
That's exactly what I'm doing.
In the module that does the delete, first it does the database call to
delete the row. Then it does the database call to re-populate the repeater grid (and put that into the DataTable). Then it sets that DataTable to the source of the grid, and then binds the data.

In fact, I've even stepped it through the code, and I saw it step right through each step as expected.
But oddly enough, it still never refreshed the grid on the form.
Thanks!
-Scott

"L. L." <ll**@cyence.com> wrote in message
news:uy**************@TK2MSFTNGP12.phx.gbl...
> Scott,
>
> When the user clicks on the Delete button, the page will post back and call
> the sp to delete the record. Apparently this part worked as you

described.
> However, after deleting the record, you need create the DataTable again and
> bind it to the grid. That will force the repeater to refresh.
>
> L.L.
> "Scott Lyon" <scott.lyonNOSPAM_at__NOSPAMrapistan.comNOSPAM> wrote in > message news:OV**************@tk2msftngp13.phx.gbl...
> > 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!
> >
> >
>
>



Nov 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Joe Fawcett | last post by:
I'm having a problem binding an asp:repeater control to a Hashtable. Originally my code was: <asp:Repeater id="rptFamily" runat="server" DataSource="<%# family %>"> <ItemTemplate> <%#...
2
by: Peter Kirk | last post by:
Hi are there any "gotchas" with using an asp:repeater that means that the "onclick" method of a LinkButton created in the repaeter does not fire? I at least cannot get it to work. I have a...
4
by: Eric | last post by:
Hello, I have the following dataset that I want to bind to a repeater to be displayed as a table. Owner Animal Volume --------------------------- Eric Dog 6 Eric Cat ...
3
by: Kelly Leahy | last post by:
I'm using an Asp:Repeater control with a text box in the item templates. This is for a system that has a number of items that the user can edit and I'd like to generate them based on a list. ...
3
by: Oleg | last post by:
I am using asp:repeater control. I would like to create a conditional row <tr> when the data in DataBinder.Eval(Container.DataItem, "Activity") returns '1'. I need something like this: <%if(...
3
by: Joe Fawcett | last post by:
Sorry about the multi post, I thought I'd sent to both groups simultaneously but somehow it failed to find this one the first time. I'm having a problem binding an asp:repeater control to a...
1
by: Timbo | last post by:
Hi all, This is my first message here so i'll try and include all the information that will help you help me out, if possible. Basically I am using C# in ASP.NET 2.0 and have a Repeater...
0
by: deathtospam | last post by:
A few weeks ago, I created a Classic ASP page that connects to a machine with SQL Server installed on it, prompts the user to select a database on that server, then lists all of user-created stored...
2
by: bissatch | last post by:
Hi, I am trying to output a list of checkboxes. Using ASP .NET controls, I was able to create the following: <label for="colour_red">Red: </label><asp:CheckBox ID="colour_red" runat="server"...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.