1
MVC 응용 프로그램에서 URL 기반 현지화 논리를 사용하고 있습니다. 그래서 기본 경로는 mysite/someControler이고 현지화 된 경로는 mysite/en-US/someControler입니다.MVC에서 문화권 변경
"en-US"는 기본값이있는 "culture"매개 변수의 값입니다.
문화권을 전환하고 URL 경로 값과 매개 변수를 모두 유지하는 일반적인 방법이 궁금합니다. 마스터 페이지
에서If Request.Path.Contains("/en/") Then
ViewData("PathEs") = Request.Path.Replace("/en/", "/es/")
ViewData("PathPt") = Request.Path.Replace("/en/", "/pt/")
ElseIf Request.Path.Contains("/pt/") Then
ViewData("PathEn") = Request.Path.Replace("/pt/", "/en/")
ViewData("PathEs") = Request.Path.Replace("/pt/", "/es/")
Else
ViewData("PathEn") = Request.Path.Replace("/es/", "/en/")
ViewData("PathPt") = Request.Path.Replace("/es/", "/pt/")
End If
: 그리고 나는 다음을 ViewData 비트를 설정 내 기본 컨트롤러에서
는 (다른 모든 컨트롤러가에서 상속) :
감사
http://adamyan.blogspot.com/2010/02/aspnet-mvc-2-localization-complete.html –