472,356 Members | 1,947 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,356 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 8079
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"...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
1
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. header("Location:".$urlback); Is this the right layout the...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it so the python app could use a http request to get...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...

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.