Click here to Skip to main content
15,881,870 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I am running a function at the press of a button in a html page. however, I am not able to figure out how to refresh the page and change the address of the page to its default/

What I have tried:

p.http_url.Replace("/index.html&action=clearall", "/index.html");
Posted
Updated 7-Nov-16 3:30am
v3

1 solution

I am unsure on what your function looks like or technologies you are using.

In JavaScript I would add the following code to the end of your function to redirect back to the same page without the querystrings values.

window.location = "http://www.yoururl.com/index.html";


If it was an ASP.Net webforms C# page, then I'd do a

Response.Redirect("index.html");
 
Share this answer
 
Comments
Member 12724052 8-Nov-16 19:49pm    
I am using TCPclient stream and streamwriter for the dynamichtml content

also is there a way I could change the url from this to */index.html? so that the domain can be anything?

<meta http-equiv="refresh" content="0; url=http://localhost:80/index.html" />

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900