刷新HTML页面C# [英] Refresh HTML page C#

查看:83
本文介绍了刷新HTML页面C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在按html页面中的按钮运行一个功能。但是,我无法弄清楚如何刷新页面并将页面地址更改为默认值/



我尝试过:



 p.http_url.Replace(/ index.html& action = clearall,/ index.html); 

解决方案

我不确定您的功能或您正在使用的技术。



在JavaScript中,我会将以下代码添加到函数末尾,以重定向到没有查询字符串值的同一页面。



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





如果是ASP.Net webforms C#page,然后我会做一个



 Response.Redirect(index.html); 


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");

解决方案

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");


这篇关于刷新HTML页面C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆