如何从母版页后面的代码重新加载页面 [英] How to reload the page from code behind of the master page

查看:98
本文介绍了如何从母版页后面的代码重新加载页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我的主页上确实有一个按钮,允许用户更改语言.如果他单击按钮(位于母版页上),我想在后面的代码中重新加载整个页面(母版和母版页).

Hallo,

I do have a button on my master page that allows the user to change the language. If he clicks on the button (which is on the master page), I want to reload the entire page (the master and the main page) in code behind. How can I do that?

推荐答案

类似的东西:

Something like:

Response.Redirect(HttpContext.Current.Request.Url.ToString(), true);


一种简单但不太合适的解决方案是使用

One of the easy and not so eligant solution is to use

Response.Redirect(Request.RawUrl);



在按钮单击事件中.

或者,您可以使用ajax/javascript重新加载页面.



in the button click event.

Alternatively, you can use ajax / javascript to reload the page.

window.location.reload()


这篇关于如何从母版页后面的代码重新加载页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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