How do you refresh a page in codebehind

PageA has a repeater which displays some number of rows from a table. After the repeater on PageA I have a textbox and an "Add" button. I enter some text into  the textbox and click on the "Add" button. In the codebehind for the "Add" button I insert the data from the textbox into the table used by the repeater and then I open PageB which displays the detail information. At some point in the codebehind for the "Add" button I need to refresh PageA so that the new information I inserted into the table is displayed by the repeater and then go to PageB.

My code in the Add button is:

Response.Redirect(Request.RawURL)

ClientScript.RegisterStartupScript(Me.GetType, "popup", "window.open('CustomerDetailForm.aspx?Cust_Code=" + strCustCode + "','_blank','menubar=no')", True)

Whatever is first in the code above happens but not the second.

How do I refresh PageA and also get to PageB?
Donna KainerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ddayx10Commented:
As soon as you do the response.redirect your code is done... nothing after that will happen because you are now "reloading" the page.

To get the repeater refreshed on pageA you probably want to rebind it to it's datasource instead of refreshing the page.

ex. repeater.databind()

I can't really comment much on the pageB issue. It seems like you are saying this is already working for you excepting that the redirect is currently stopping it from functioning. There are several ways you may or may be going about this and its just not feasible to comment on that at this time.

You would need to change the code from a registerstartupscript to registerclientscriptblock for it to function without the "reload".

So instead of:

response.redirect
registerstartupscript

Go with:
repeater.databind
registerclientscriptblock
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Donna KainerAuthor Commented:
This is exactly what I needed. It is so simple I don't know why I did not think of it myself.

There is not a problem with pageB. I only included it so that the whole picture could be seen. Thanks.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.