如何在语言更改后翻译母版页中的内容页 (ASP.NET)
我在 ASP.NET 的母版页中有一个内容页。 发生的情况是,用户单击母版页右上角的按钮并更改当前语言。 该按钮的作用是将会话更改为新选择的语言。
发生的情况是,当您单击按钮时,代码会在调用母版页和内容页的 Page_Load 之后执行。 但在我的按钮中,我调用一个函数“翻译”来翻译母版页。
不幸的是,我不知道如何处理内容页面。 我尝试手动重新加载它,但我不知道如何。
这里有人可以帮助我吗? 我认为这里不需要代码,但如果它可以帮助您,只需问我您需要什么,我会更新。
谢谢贾夫
I have a content page in a master page in ASP.NET.
What is going on is that the user click on a button in the right corner of the master page and that change the current language. What does the button is changing the Session for the new selected language.
What is happening is that when you click on a button, the code is executed AFTER the Page_Load of both the master page and the content page is called. But in my button, I call a function "Translate" that do the translation of the master page.
Unfortunately, I don't know what to do for the content page. I tried to do a manual reload of it but I don't know how.
Is there anyone here that can help me? I don't think that code is needed here but if it can help you, just ask me what you need and I will update.
Thanks
Jaff
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
更改用户语言设置(在线程上以及您保存该信息的任何地方)后,执行 Response.Redirect 到他们已经所在的页面。 这允许干净的页面加载,并减少其他区域性特定设置导致问题的可能性(例如日期和时间选择)。
After changing the users language settings (both on the thread and where ever you persist that information too) do a Response.Redirect to the page they are already on. This allows for a clean page load and reduces the chance that other culture specific settings will cause a problem (such as date and time selections.)