protected void Button1_Click(object sender, EventArgs e)
{
??????????????????
}
??处该怎么写
C#.net点击按钮刷新页面(点击按钮相当于键盘按F5)
答案:6 悬赏:70 手机版
解决时间 2021-01-22 12:32
- 提问者网友:练爱
- 2021-01-22 01:40
最佳答案
- 五星知识达人网友:你哪知我潦倒为你
- 2020-08-11 05:59
js就可以了
<input type="button" value="刷新" onclick="location.reload()" />
后台的话可以跳转到本页面
protected void Button1_Click(object sender, EventArgs e)
{
Response.Redirect(Request.Url.ToString());
}
<input type="button" value="刷新" onclick="location.reload()" />
后台的话可以跳转到本页面
protected void Button1_Click(object sender, EventArgs e)
{
Response.Redirect(Request.Url.ToString());
}
全部回答
- 1楼网友:孤独入客枕
- 2020-09-16 16:17
我觉得也对 你重新加载一遍不就行了吗? Response.Redirect("你页面的路径");
- 2楼网友:空山清雨
- 2019-11-10 13:56
ScriptManager.RegisterStartupScript(Button1, this.GetType(), "shuaxin", "window.location.reload();", true);
- 3楼网友:平生事
- 2019-07-15 04:43
protected void Button1_Click(object sender, EventArgs e)
{
Response.Write("<script language='JavaScript'>window.location='a.aspx';</script>");
}
- 4楼网友:躲不过心动
- 2019-12-25 15:19
js就可以了
后台的话可以跳转到本页面
protected void button1_click(object sender, eventargs e)
{
response.redirect(request.url.tostring());
}
- 5楼网友:北城痞子
- 2019-06-29 14:11
如果,Button1是服务器控件,那么后台用
protected void Button1_Click(object sender, EventArgs e)
{
Response.Write("<script language=javascript>window.location.href=window.location.href;</script>");
//或者2
//2, ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "refresh", "window.location.href=window.location.href;", true);
}
如果Button1是HTML控件,有前台<input type="button" value="刷新" onclick="location.reload()" /> 就行了。
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯