locked
change culture for all pages (in button commant event) RRS feed

  • Question

  • User-307312920 posted

    I've used 3 languages on my site and I’ve also put 3 Image Buttons.
    The language image button that you click will allow that language to be seen on the site. What should I write for that command btn (btn1_command event)

    but when I cllick language button, culture should change for all pages for only current user.

    other users can use different culture.

    how can I


    Wednesday, March 3, 2010 9:50 AM

Answers

  • User-1636183269 posted

    Hello,

    Create base page drived from System.Web.UI.Page named as BaseBage. and InitializeCulture i am setting in base page and all pages I am driving from BasePage instead of System.Web.UI.Page, so there is no need to write this method for each page.

    Hope you understood what I mean.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, March 4, 2010 11:54 AM

All replies

  • User-1200560727 posted

    Hi,

    Please go through my below post:

    http://forums.asp.net/t/1526291.aspx

    I hope it will helpful to solve your problem. Please let me know if you still find the same problem.

    Regards,

    Tapan


    Wednesday, March 3, 2010 11:20 PM
  • User-1636183269 posted

    You can pass value in querystring, it will work for you. I have created sample for same. Please go through hope it will help. Please let me know if you need more info.

    http://forums.asp.net/t/1514920.aspx


    Thursday, March 4, 2010 3:58 AM
  • User-307312920 posted

    thanks for answers.

    I tried initializeculture mehtod. but this method is changing culture for only current page.

    I must write all pages this code .

    I want , when I click language button , change culture all pages. I don't want to write all pages initializeculture method.

    Is this possible.


    Edit:

    for example

     can I create class file. and Can I use this class like initializeculture method and Can I add masterpage this class.

    is this possible.

    or other method???

    Note : I think using  session for selected culture (when clicked image button)

    Thursday, March 4, 2010 10:42 AM
  • User-1636183269 posted

    Hello,

    Create base page drived from System.Web.UI.Page named as BaseBage. and InitializeCulture i am setting in base page and all pages I am driving from BasePage instead of System.Web.UI.Page, so there is no need to write this method for each page.

    Hope you understood what I mean.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, March 4, 2010 11:54 AM
  • User-307312920 posted

    thanks.

    this good idea.  thanks thanks thanks :).


    Thursday, March 4, 2010 2:18 PM
  • User-121444754 posted

    But if i'm creating a Web Application , the class from App_Code folder does not compile, and also in Web Application the App_Code folder is absent , i can create it mannually but it not acts like in a website....
    any sugestions ? 

    Friday, June 14, 2013 7:20 AM