我的网站使用 VS 2010 / vb 本地化为 10 种语言。当我首先单击该标志时,它会更改为该语言。但是当我单击另一种语言时,它不会切换;我必须再次单击它才能切换。有谁知道我的问题是什么?
这是我的 homepage.master.vb 背后的代码:
Imports System
Imports System.Data
Imports System.Configuration
Imports System.Collections
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Web.UI.HtmlControls
Imports Udev.MasterPageWithLocalization.Classes
Partial Public Class Homepage
Inherits System.Web.UI.MasterPage
Protected Sub Page_Load(sender As Object, e As EventArgs)
End Sub
Protected Sub RequestLanguageChange_Click(sender As Object, e As EventArgs)
Dim senderLink As LinkButton = TryCast(sender, LinkButton)
'store requested language as new culture in the session
Session(Udev.MasterPageWithLocalization.Classes.Global.SESSION_KEY_CULTURE) =
senderLink.CommandArgument()
'reload last requested page with new culture
Server.Transfer(Request.Path)
End Sub
End Class
这是我的 default.aspx.vb 背后的代码:
Imports System
Imports System.Data
Imports System.Configuration
Imports System.Collections
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Web.UI.HtmlControls
Imports Udev.MasterPageWithLocalization.Classes
Partial Public Class _Default
Inherits BasePage
Protected Sub Page_Load(sender As Object, e As EventArgs)
End Sub
End Class
任何建议或指导将不胜感激!