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

  • SEARCH
  • Home
  • 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 6230979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:51:00+00:00 2026-05-24T09:51:00+00:00

I have successfully implemented a multi-language website in which user can change language by

  • 0

I have successfully implemented a multi-language website in which user can change language by clicking one of the imagebuttons.
I used a Hiddenfield to store code of language that was selected by the user (on Imagebutton click event).
My InitializeCulture method looks like this:

     protected override void InitializeCulture()
    {
    string culture = "Auto";
    string selectedValue = Request.Form["ctl00$HiddenFieldLang"];
    switch (selectedValue)
    {
        case "1": culture = "Auto";
            break;
        case "2": culture = "zh-HK";
            break;
        default: break;
    }

    if (culture != "Auto")
    {
        System.Globalization.CultureInfo ci = new System.Globalization.CultureInfo(culture);
        //ci = System.Globalization.CultureInfo.CreateSpecificCulture(culture);
        System.Threading.Thread.CurrentThread.CurrentCulture = ci;
        System.Threading.Thread.CurrentThread.CurrentUICulture = ci;
    }
    base.InitializeCulture();
    }

This works fine. But it takes 2 postbacks to change the language of the page. I’m guessing, in one postback (which changes nothing), the hiddenfield’s value is set. In second postback, actual translation takes place.

How do I implement it so that the page is translated in just one click of imagebutton?

Thanks!!

  • 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-05-24T09:51:00+00:00Added an answer on May 24, 2026 at 9:51 am

    Thank you all for the replies.
    I managed to solve this problem with the help of this link.

    But I have another issue now.
    I have a masterpage and I put the Hiddenfield and the Javascript function to set the value of hiddenfield in my masterpage. In the URL of all my pages, I have a querystring with the language id. So, whenever the language changes, I want to change the querystring as well.

    Is there any way I can fetch the URL of current content page from the masterpage and do a Response.Redirect or Server.Transfer from SetHiddenValue(val) function itself and ensure that the text is translated?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have successfully implemented my AutoCompleteTextView which is based off an SQLite query and
I have successfully implemented a custom SimpleCursorAdapter for an AutoCompleteTextView, which suggests entries from
I have successfully implemented the scrollTo jQuery plugin which scrolls to the next div
I have successfully implemented interop beftween Win32 application and managed .Net dll as described
I have successfully implemented Forms Authentication in SSRS, so it now uses both Roles
I have successfully implemented printing and print preview for my app using the PrintDocument,
I have successfully implemented SUBSONIC DAL in my desktop application. it was superb experience.
I'm just learning Qt with C++. I have successfully implemented signals and slots to
I have successfully upgraded an MFC application which was compiled with an old version
I have successfully used the Excel and Word addin templates in Visual studio 2008

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.