Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Error In Localization Pleas Help

Error In Localization Pleas Help

Scheduled Pinned Locked Moved ASP.NET
helpdesignsysadminquestionlearning
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mdazeemuddin
    wrote on last edited by
    #1

    Hi All, i am developing one web application with two language in English and Arabic in my application i used master page and other pages are content pages i used Link Button for Language selection in master page i create BasePage.cs in App_Code the BasePage.cs code is 1 protected override void InitializeCulture() 2 { 3 string currentCulture = Convert.ToString(Session["userCulture"]); 4 if (!string.IsNullOrEmpty(currentCulture)) 5 currentCulture = currentCulture; 6 else 7 currentCulture = "en-us"; 8 Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(currentCulture); 9 Thread.CurrentThread.CurrentUICulture = new CultureInfo(currentCulture); 10 11 base.InitializeCulture(); 12 } i create Global.asax file also and the code for this is void Session_Start(object sender, EventArgs e) { Session["MyCulture"] = "en-us"; } in MasterPage.master i write the code for ButtonEvent for OnClick event and the code is protected void changeCulture_Click(object sender, EventArgs e) { LinkButton senderLink = sender as LinkButton; Session["userCulture"] = senderLink.CommandArgument; Server.Transfer(Request.Path); } and i create the resource file for only one page that is orderonline page in Arabic and in English i put this file in App_Resource folder and i make all pages derive from BasePage instead of Standard System.web.UI.Page now my question is when i run this application and i try to click the Arabic or English Button to change the language instead of generating the onclick event from the linkbutton simply its submitting form in orderonline.aspx which have resource file in App_Resource folder if i open some other page like about us etc from this page i can easily change the language where i am doing mistake i don't can any one help me for solving this problem thank in advance for any help

    H 1 Reply Last reply
    0
    • M mdazeemuddin

      Hi All, i am developing one web application with two language in English and Arabic in my application i used master page and other pages are content pages i used Link Button for Language selection in master page i create BasePage.cs in App_Code the BasePage.cs code is 1 protected override void InitializeCulture() 2 { 3 string currentCulture = Convert.ToString(Session["userCulture"]); 4 if (!string.IsNullOrEmpty(currentCulture)) 5 currentCulture = currentCulture; 6 else 7 currentCulture = "en-us"; 8 Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(currentCulture); 9 Thread.CurrentThread.CurrentUICulture = new CultureInfo(currentCulture); 10 11 base.InitializeCulture(); 12 } i create Global.asax file also and the code for this is void Session_Start(object sender, EventArgs e) { Session["MyCulture"] = "en-us"; } in MasterPage.master i write the code for ButtonEvent for OnClick event and the code is protected void changeCulture_Click(object sender, EventArgs e) { LinkButton senderLink = sender as LinkButton; Session["userCulture"] = senderLink.CommandArgument; Server.Transfer(Request.Path); } and i create the resource file for only one page that is orderonline page in Arabic and in English i put this file in App_Resource folder and i make all pages derive from BasePage instead of Standard System.web.UI.Page now my question is when i run this application and i try to click the Arabic or English Button to change the language instead of generating the onclick event from the linkbutton simply its submitting form in orderonline.aspx which have resource file in App_Resource folder if i open some other page like about us etc from this page i can easily change the language where i am doing mistake i don't can any one help me for solving this problem thank in advance for any help

      H Offline
      H Offline
      Herman T Instance
      wrote on last edited by
      #2

      Maybe you should use Response.Redirect(Request.Url.ToString()); instead of using Server.Transfer(Request.Path); Maybe you could also post you aspx code as the parts of yout aspx.cs code so we can see how it works.

      In Word you can only store 2 bytes. That is why I use Writer.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups