[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Refresh page ASP.NET C#

Posted on 2016-09-22
3
Medium Priority
?
406 Views
Last Modified: 2016-09-22
We have a webpage form in asp.net c# that write to a text file with File.ReadAllLines. Now we want to know after make the change how can we refresh the actual web page form? Because we have in the form text labels to update the change of ReadAllLines process but only work if you logout and login again or if you make refresh in the browser. Then we need to make refresh after make the change for the data update properly or at least execute that webpage form the first time and execute all since the page private load code behind. How can we do that?
0
Comment
Question by:Alex E.
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 21

Expert Comment

by:Randy Poole
ID: 41811432
Assuming you have a scriptmanager on your page then do the following after you are done processing the submission:
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "redo", "location.reload(true);", true);

Open in new window

0
 

Author Comment

by:Alex E.
ID: 41811471
We have a button when the user clicks that button execute the File.ReadAllLines process and we entered at the end your command:

ScriptManager.RegisterStartupScript(Page, Page.GetType(), "redo", "location.reload(true);", true);

Open in new window


And makes refresh but in an endless loop there is no way to escape. All time is refreshing and you see the page refreshing but you can touch any button? Is there a way to use that command wihtout the endless loop?
0
 
LVL 21

Accepted Solution

by:
Randy Poole earned 2000 total points
ID: 41811485
Try replacing what I gave you with:
Response.Redirect(Request.RawUrl);

Open in new window

1

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question