Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8783599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:51:36+00:00 2026-06-13T20:51:36+00:00

I have a multilingual company website (Visual Studio / VB / ASP.NET 4.0), and

  • 0

I have a multilingual company website (Visual Studio / VB / ASP.NET 4.0), and when, on the homepage, you click a flag, the text changes to that language and stays with you the entire session, after I made a class, BasePage.vb. Everything works great, but the URL never changes …. clients.aspx remains clients.aspx although the text DOES switch to Dutch.

It’s been recommended by @Aritstos to make it so it looks like clients.aspx?lang=nl as opposed to just clients.aspx in another language.

Currently, my asp homepage hyperlinks that work look like this:

      <asp:LinkButton ID="LinkButton7" runat="server"
      CommandArgument="nl" OnClick="RequestLanguageChange_Click"
      class="flagbutton">      
      <asp:Image ID="Image1" runat="server" ImageUrl="~/images/flagnl.png"
      tooltip="Bekijk deze website in het Nederlands" title="Bekijk deze website 
      in het Nederlands"/>
      <img class="map" src="images/flaghovernl.png" alt=""/>
      </asp:LinkButton>

I tried to change the asp links to html links, like this:

     <a href="default.aspx?lang-nl" class="flagbutton">
     <img src="images/flagnl.png" alt="Bekijk deze website in het Nederlands"
     title="Bekijk deze website in het Nederlands"/>
     <img class="map" src="images/flaghovernl.png" alt=""/>

But that didn’t work. The page doesn’t switch languages to Dutch. And when I click on any link, say, about.aspx, the ?lang-nl disappears. So nothing appears in Dutch. I was told the asplinks do the javascript_dopostback? which is bad. Can somebody please tell me how to change my links so that they create a string at the end of the URL saying “?lang-nl” at the end, and it stays like that through their entire session? Any help would be sincerely appreciated!

PS — here is the code for my BasePage.vb:

    Imports Microsoft.VisualBasic
    Imports System
    Imports System.Data
    Imports System.Configuration
    Imports System.Globalization
    Imports System.Threading
    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

     Namespace Udev.MasterPageWithLocalization.Classes
      ''' <summary>
      ''' Custom base page used for all web forms.
      ''' </summary>
      Public Class BasePage
          Inherits Page
          Protected Overrides Sub InitializeCulture()
              'retrieve culture information from session
              Dim culture__1 As String =  
  Convert.ToString(Session([Global].SESSION_KEY_CULTURE))

              'check whether a culture is stored in the session
              If culture__1.Length > 0 Then
                  Culture = culture__1
              End If

              'set culture to current thread
              Thread.CurrentThread.CurrentCulture =  
  CultureInfo.CreateSpecificCulture(culture__1)
              Thread.CurrentThread.CurrentUICulture = New CultureInfo(culture__1)

              'call base class
              MyBase.InitializeCulture()
          End Sub
      End Class
  End Namespace

In my Global.vb, I have this:

  Namespace Udev.MasterPageWithLocalization.Classes
      ''' <summary>
      ''' Summary description for Global
      ''' </summary>
      Public Structure [Global]
          Public Const SESSION_KEY_CULTURE As String = "culture"
      End Structure
  End Namespace

In my Culture.vb, I have this:

  Namespace Udev.MasterPageWithLocalization.Classes
      ''' <summary>
      ''' This class provides ISO definitions for all cultures that are supported by 
    this application.
      ''' </summary>
      Public Structure Culture
          'German - Switzerland definition
          Public Const DE As String = "de"
          'English - Great Britain definition
          Public Const EN As String = "en"
      End Structure
  End Namespace
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T20:51:38+00:00Added an answer on June 13, 2026 at 8:51 pm

    to read parameters from the url in your case is the (lang) in clients.aspx?lang=nl you can use:

    Request.QueryString("lang")
    

    this way you can use a simple if or a select case statements to determine which language the user is requesting. something like this:

    Select Case Request.QueryString("lang")
        Case "en"
            ' switch the english
        Case "ar"
            ' switch to arabic
        Case "jp"
            ' switch to japan
        Case Else
            ' your default
    End Select
    

    now to keep the same language to the user as she navigates the site you can save it in a session using the code:

    Session("lang") = "en"
    

    and to read the session value use the code:

    Dim lang as String = CType(Session.Item("lang"), String)
    

    now when we combine both methods and making sure there will be no conflic:

    ' check if there is a lang value in the url
        If Request.QueryString("lang").Length > 0 Then
            Select Case Request.QueryString("lang")
                Case "en"
                    Session("lang") = "en"
                    ' switch the english languge
                Case "ar"
                    Session("lang") = "ar"
                    ' switch to arabic
                Case "jp"
                    Session("lang") = "jp"
                    ' sitch to japaneese
                Case Else
                    Session("lang") = "en"
                    ' your default language
            End Select
    
        Else
            ' check if there is a value in the session
            Select Case CType(Session.Item("lang"), String)
                Case "en"
                    ' switch the english languge
                Case "ar"
                    ' switch to arabic
                Case "jp"
                    ' sitch to japaneese
                Case Else
                    ' your default language
            End Select
        End If
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made my application multilingual. It changes it's language when you click the
I have been working on a multilingual website which has been developed in ASP.net
i have multilingual asp.net site. there is a masterpage and default.aspx. I put two
I have an application that is multilingual. I'm using the out-of-the-box .Net features for
I have a multilingual website (Chinese and English). I like to validate a text
We are now using Django to develop a multilingual website. We have different language
I somehow managed to make my company's website in 9 languages, using Visual Studio
We have to build an event registration website for our client in ASP.NET using
I have developed a multilingual web application with Asp.Net. I want to a question
I have an asp.net web application which I want have multilingual support now. For

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.