Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
I think you get get it from the RequestContext.RouteData.Values["tag"]. Try that, I am not for sure but it should.
That doesn't work atleast in my case when I used following statement in the view:
Parent View:
@{ Html.RenderContentData(content, false, "Card"); } //"Card" is tag that should be used to resolve render
[TeplateDescriptor(Tags=new []{"Card", "Line") ...]
MyController: ContentControler<MyContentType>{
public Action Result(MyContentType currentContent){
//... I want to switch actual view by current active tag
}
}
I've looked at decompiled code of RenderContentData method, and found out that it uses tag value passed only to resolve template. It doesn't put it anywhere.
So I assume that there is no out of the box way to do that.
Is it possible to obtain current Tag that was used to resolve template renderer in context of template renderer (mvc controller)?