Re: ERROR WHEN CULTURE IS SET TO ar-SA

  •  01-11-2011, 2:39 PM

    Re: ERROR WHEN CULTURE IS SET TO ar-SA

    we set the culture based o the users country (from their IP) in the following way
     
    This code is palced by overriding the Controllers's (in MVC)  OnActionExecuting(ActionExecutingContext filterContext)
     
    so the whole thing is
     

    protected override void OnActionExecuting(ActionExecutingContext filterContext)

    {

    base.OnActionExecuting(filterContext);

    System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture(Session["Culture"].ToString());

    System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(Session["Culture"].ToString());

     

    }

View Complete Thread