Refreshing a page after data is updated

D

darrel

I have a form that postsback to the server to update a DB table A. In this
form I have a repeater that is populated from DB table B.

Within this form, I have another button that, when clicked, will update DB
table B.

The problem I am having is that when this button is clicked, the following
happens:

Postback
OnPageLoad (binds data to the repeater)
Button_click (adds new item to the DB table B)

As you can see, the problem is that on postback, even though the table is
updated, the page isn't reflecting that because the data was bound prior to
the button_click function being excecuted.

No, normally I'd just put a response.redirect in the button click function
to reload the page after the data is inserted into the table. However, in
this case, I don't want that, as I want to preserve any edited fields in the
parent form...so I need to preserve the postback.

The one thought I have is instead of putting the update DB function within
the button_click function is to instead put it in the page_load BEFORE I
call the function to bind data to the repeater. However, I'm not sure what I
could check for there to see if that particular button was clicked. Any
thoughts?

-Darrel
 
D

darrel

I don't want that, as I want to preserve any edited fields in the
parent form...so I need to preserve the postback.

Which got me thinking...can I pass the postback data back via a querystring?
Or is there a way to trigger a postback from the codebehind (something like
response.postback(thispage))?

-Darrel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top