Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

IActionFilter with culture

$
0
0

Hi,

I am studying filters issues. I want to set culture in filters. I got it. but I have to refresh page on filters why ?

If I dont use response.redirect, I cant see localization settings. if page changes, localization is ok. 

or I have to context.HttpContext.Response.Redirect(url)  

namespace MIS.WebUI.Filters
{
    public class CustomFilter : Attribute, IActionFilter
    {
        public void OnActionExecuting(ActionExecutingContext context)
        {
.... CultureInfo ci = new CultureInfo("en-GB"); Thread.CurrentThread.CurrentUICulture = ci; Thread.CurrentThread.CurrentCulture = ci; //string url = context.HttpContext.Request.Path; //context.HttpContext.Response.Redirect(url); } public void OnActionExecuted(ActionExecutedContext context) { } } }


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>