This question is locked. New answers and comments are not allowed.
I cannot for the life of me figure out how to use display/editor templates inside of tabs. How is this supposed to be done??
I have tried all of the following without success:
Most obvious option:
Hacky-but-should-be-functional option:
Hackier-but-should-work option:
The ONLY thing that I can get to work properly is RenderPartial but I want this done with the templates because this also breaks internal EditorFor() calls which practically means I cannot use templates at all since all of our partial views are used all over the place.
RenderPartial works:
I have tried all of the following without success:
Most obvious option:
<%
Html.Telerik().TabStrip()
.Name("PriceRequestDetailsTabs")
.Items(parent =>
{
parent.Add()
.Text("Details")
.Selected(true)
.Content(() => Html.DisplayFor(m => m, "RetailPriceRequests/PriceRequestDetail"));
parent.Add()
.Text("Tier/Load Data")
.Content(() => {%>x<% });
})
.ClientEvents(events => events.OnSelect("onSelect"))
.Render();
%>
Hacky-but-should-be-functional option:
Html.Telerik().TabStrip()
.Name(
"PriceRequestDetailsTabs"
)
.Items(parent =>
{
parent.Add()
.Text(
"Details"
)
.Selected(
true
)
.Content(() =>
{
%>
<%= Html.DisplayFor(m => m,
"RetailPriceRequests/PriceRequestDetail"
) %>
<%
});
parent.Add()
.Text(
"Tier/Load Data"
)
.Content(() => {%>x<% });
})
.ClientEvents(events => events.OnSelect(
"onSelect"
))
.Render();
Hackier-but-should-work option:
Html.Telerik().TabStrip()
.Name(
"PriceRequestDetailsTabs"
)
.Items(parent =>
{
parent.Add()
.Text(
"Details"
)
.Selected(
true
)
.Content(() =>
{
%>
<%
Html.DisplayFor(m => m,
"RetailPriceRequests/PriceRequestDetail"
).ToHtmlString(); %>
<%
});
parent.Add()
.Text(
"Tier/Load Data"
)
.Content(() => {%>x<% });
})
.ClientEvents(events => events.OnSelect(
"onSelect"
))
.Render();
The ONLY thing that I can get to work properly is RenderPartial but I want this done with the templates because this also breaks internal EditorFor() calls which practically means I cannot use templates at all since all of our partial views are used all over the place.
RenderPartial works:
<%
Html.Telerik().TabStrip()
.Name("PriceRequestDetailsTabs")
.Items(parent =>
{
parent.Add()
.Text("Details")
.Selected(true)
.Content(() => Html.RenderPartial("~/Views/Shared/DisplayTemplates/RetailPriceRequests/PriceRequestDetail.ascx", Model));
parent.Add()
.Text("Tier/Load Data")
.Content(() => {%>x<% });
})
.ClientEvents(events => events.OnSelect("onSelect"))
.Render();
%>