Správičky 2 793 Blogy 945 Fórum 18 396

core 1.1 localizer

photo
core
30. 6. 2017 6:12:41
Body: 120
Najaktívnejší č.: 91

core 1.1 localizer

Riesim prepinanie localizer,tento system c.1 prepina ok ale iba na cele stranky ako komplet
2.system prepina ok aj na partion site, 
3.uloha ako spravit z 2 systemu aby umoznoval click nna prislusnu flag a zafungoval ,nechcem  rolovanie ,ale click na pevnu flag /mam dve - sk a de/
system c.1.	<li><a href="/?culture=sk-SK & uiCulture=sk-SK"><img src="~/images/flag-sk.png" style="height:20px !important" alt="sk"></a></li>

system c.2.<div style="position:relative" title="@Localizer["Request culture provider:"] @requestCulture?.Provider?.GetType().Name">
    <form  id="selectLanguage" asp-controller="Home" asp-action="SetLanguage" asp-route-returnUrl="@Context.Request.Path" method="post" class="form-horizontal" role="form">
      <select name="culture" asp-for="@requestCulture.RequestCulture.UICulture.Name" asp-items="cultureItems"></select>
    </form>
    <ul>
public IActionResult SetLanguage(string culture, string returnUrl)
        {
          
            Response.Cookies.Append(
                CookieRequestCultureProvider.DefaultCookieName,
                CookieRequestCultureProvider.MakeCookieValue(new RequestCulture(culture)),
                new CookieOptions { Expires = DateTimeOffset.UtcNow.AddYears(1) }
            );

            return LocalRedirect(returnUrl);
        }

 

[Reakcia]

photo
core
30. 6. 2017 6:51:58
Body: 120
Najaktívnejší č.: 91

RE: core 1.1 localizer

Skusal som aj toto ale neurobilo local redirect
<li> <a asp-controller="Home" asp-action="SetLanguage" > <img src="~/images/flag-sk.png"></a></li>
  [HttpPost]
        public IActionResult SetLanguage()
        {
            string culture = "de-DE";
            string returnUrl = "~/";
            Response.Cookies.Append(
                CookieRequestCultureProvider.DefaultCookieName,
                CookieRequestCultureProvider.MakeCookieValue(new RequestCulture(culture)),
                new CookieOptions { Expires = DateTimeOffset.UtcNow.AddYears(1) }
            );

            return LocalRedirect(returnUrl);
        }

 

[Reakcia]

photo
core
30. 6. 2017 7:35:36
Body: 120
Najaktívnejší č.: 91

RE: core 1.1 localizer

chybu som odstranil volal som post

[Reakcia]

photo
T
4. 7. 2017 9:21:54
Body: 21170
Najaktívnejší č.: 2

RE: core 1.1 localizer

Preco nevratis rovno view ale robit redirect?

Tomáš Zeman, MCSD.NET, MCPD

[Reakcia]

photo
core
22. 7. 2017 23:24:24
Body: 120
Najaktívnejší č.: 91

RE: core 1.1 localizer

ako mam vratit view?

[Reakcia]

photo
core
24. 7. 2017 18:17:28
Body: 120
Najaktívnejší č.: 91

RE: core 1.1 localizer

ok mam to asp-route-returnUrl="@Context.Request.Path"

[Reakcia]



Najaktívnejší užívatelia
1. 37745 b. photo vlko
2. 21170 b. photo T
3. 15955 b. photo spigi
4. 15450 b. photo Anonymous
5. 11110 b. photo dudok
6. 9050 b. photo Liero
7. 6885 b. photo siro
8. 6245 b. photo slavof
9. 5355 b. photo duracellko
10. 4430 b. photo xxxmatko