2011-09-03 2 views
2

정적 콘텐츠를 CDN으로 옮기고 싶습니다. 그러나 나는 T4MVC를 좋아하고 그것을 계속 사용하고 싶다. 그래서 이상적으로는 "http : // mysite"를 "http : // cdnaddress/path"로 바꾸기를 원합니다. 누군가 그것을 시도 했습니까? 어떤 함정이라도있을 수 있을까요? T4MVC.tt.settings.t4에서 ProcessVirtualPathDefault에 대한T4MVC에서 CDN

+0

t4mvc는 그와 관련이 없습니다. –

+2

@ 대니얼, 정말로? T4MVC는 "강하게 타이핑 된"정적 링크를 생성합니다. – SiberianGuy

답변

4

봐는 :

// You can change the ProcessVirtualPath method to modify the path that gets returned to the client. 
// e.g. you can prepend a domain, or append a query string: 
//  return "http://localhost" + path + "?foo=bar"; 
private static string ProcessVirtualPathDefault(string virtualPath) { 
    // The path that comes in starts with ~/ and must first be made absolute 
    string path = VirtualPathUtility.ToAbsolute(virtualPath); 

    // Add your own modifications here before returning the path 
    return path; 
} 

이 코드를 조정하여 원하는 것을 달성 할 수 있어야한다.